layui左側導航收縮 Layui框架中“l(fā)ayui-this”這個屬性怎么動態(tài)?
Layui框架中“l(fā)ayui-this”這個屬性怎么動態(tài)?首先,偵聽click事件,刪除Li的所有l(wèi)ay UI this屬性,然后將lay UI this屬性設置為所需的Li。請參閱JQ示例:$()。
Layui框架中“l(fā)ayui-this”這個屬性怎么動態(tài)?
首先,偵聽click事件,刪除Li的所有l(wèi)ay UI this屬性,然后將lay UI this屬性設置為所需的Li。
請參閱JQ示例:
$()。Layui NAV項目“)。在(“click”,function(){
if(!$(這個)。Hasclass(“l(fā)ayui this”){
$(this)。Addclass(“l(fā)ayui this”)。兄弟姐妹(”。Layui NAV項目“)。Removeclass(“l(fā)ayui this”)//點擊判斷沒有l(wèi)ayui this,添加,刪除其他
})