為什么我的效果是反的,在左邊列表項(xiàng)移動(dòng)時(shí),背景色和二級(jí)菜單的切換變延遲了,但是移到二級(jí)菜單時(shí),二級(jí)菜單卻消失了
為什么我的效果是反的,在左邊列表項(xiàng)移動(dòng)時(shí),背景色和二級(jí)菜單的切換變延遲了,但是移到二級(jí)菜單時(shí),二級(jí)菜單卻消失了
為什么我的效果是反的,在左邊列表項(xiàng)移動(dòng)時(shí),背景色和二級(jí)菜單的切換變延遲了,但是移到二級(jí)菜單時(shí),二級(jí)菜單卻消失了
2017-05-15
舉報(bào)
2018-12-04
$(document).ready(function() {
? var sub = $('#sub')
? var activeRow
? var activeMenu
? var timer
? var mouseInSub = false
? sub.on('mouseenter',function(e){
? ? mouseInSub = true
? }).on('mouseleave',function(e){
? ? mouseInSub = false
? })
? $('#test')
? ? .on('mouseenter', function(e) {
? ? ? sub.removeClass('none')
? ? })
? ? .on('mouseleave', function(e) {
? ? ? sub.addClass('none')
? ? ? if (activeRow){
? ? ? ? activeRow.removeClass('active')
? ? ? ? activeRow = null
? ? ? }
? ? ? if (activeMenu) {
? ? ? ? activeMenu.addClass('none')
? ? ? ? activeMenu = null
? ? ? }
? ? })
? ? .on('mouseenter', 'li', function(e) {
? ? ? if (!activeRow){
? ? ? ? activeRow = $(e.target).addClass('active')
? ? ? ? activeMenu = $('#' + activeRow.data('id'))
? ? ? ? activeMenu.removeClass('none')
? ? ? ? return
? ? ? }
? ? ? if (timer) {
? ? ? ? clearTimeout(timer)
? ? ? }?
? ? ? ?timer = setTimeout(function(){
? ? ? ? if (mouseInSub) {
? ? ? ? ? return
? ? ? ? }?
? ? ? ? activeRow.removeClass('active')
? ? ? ? activeMenu.addClass('none')
? ? ? ? activeRow = $(e.target)
? ? ? ? activeRow.addClass('active')
? ? ? ? activeMenu = $('#' + activeRow.data('id'))
? ? ? ? activeMenu.removeClass('none')
? ? ? ? timer = null
? ? ? ?},300)
? ? ??
? ? })
})
我的也是一樣 ?怎么辦?
2017-06-29
一級(jí)菜單 時(shí)而選中 時(shí)而選不中,在一級(jí)菜單中 delay 時(shí)而FALSE 時(shí)而TRUE
2017-06-21
出現(xiàn)同樣的問題:左邊一級(jí)菜單上下滑動(dòng)時(shí)二級(jí)菜單會(huì)跟隨切換;但是,從一級(jí)菜單向右移動(dòng)到二級(jí)菜單時(shí),二級(jí)菜單消失不顯示,求解答?
2017-05-16
貼出你的代碼看看。