-
mouseenter和mouseover的區(qū)別
查看全部 -
行間距查看全部
-
加入延遲來優(yōu)化
查看全部 -
mouseenter和mouseover的區(qū)別
查看全部 -
66666查看全部
-
1查看全部
-
差乘公式,判斷點在三角形內(nèi):pa*pb & pb*pc & pc*pa 符號相同 證明p點在三角形內(nèi)
查看全部 -
debounce,當連續(xù)觸發(fā)時,執(zhí)行最后一次
查看全部 -
e.target相當于this,但是this因為冒泡原理,他隨時可能變成ul的this,所以用e.target,就相當于選中唯一的li的this
查看全部 -
js可以方便地刪除和移動類
查看全部 -
<style> .wrap{ position:relative; width:200px; left:50px; top:50px; } ul{ padding:15px?0; margin:9; list-style:?none; color:#ffffff; background:#6c6669; border-right-width:?0; } li{ display:block; height:30px; line-height:?30px; cursor:?pointer; font-size:?12px; position:relative; padding-left:?12px; } li.astive{ background:?#999395; } li?span:hover{ color:#c81623; } .none{ ??????????????display:none; } #sub{ width:600px; position:absolute; border:1px?solid?#f7f7f7; background:#f7f7f7; box-shadow:2px?0?5px?rgba(0,0,0,0.3)?; left:200px; top:0; padding:10px; } .sub_content?a{ font-size:?12px; color:#666; text-decoration:?none; } .sub_content?dd?a{ border-left:?1px?solid?#e0e0e0; padding:0?10px; margin:4px?0; } .sub_content?dl{ overflow:?hidden; } .sub_content?dt{ float:left; width:70px; font-weight:?bold; clear:left; position:relative; } .sub_content?dd{ float:left; margin-left:5px; border-top:?1px?solid?#eee; margin-bottom:?5px; } .sub_content?dt?i{ width:4px; height:14px; ????????font-size:?14px; position:absolute; right:5px; top:5px; } </style>//css代碼 js代碼 $(document).ready?(function()?{ var?sub?=?$('#sub') var?activeRow var?activeMenu $('#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 } activeRow.removeClass('active') activeMenu.addClass('none') activeRow?=?$(e.target) activeRow.addClass('active') activeMenu?=?$('#'?+?activeRow.data('id')) activeMenu.removeClass('none') }) })
查看全部 -
測試查看全部
-
標簽a一般為12px查看全部
-
事件綁定查看全部
-
切換技術(shù)查看全部
舉報
0/150
提交
取消