Update element.js

tab 删除li click定位不准,加上判断tabName
pull/1075/head
MonsterUncle 2 years ago committed by GitHub
parent 02ed929104
commit fb2d5d455c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -131,9 +131,9 @@ layui.define('jquery', function(exports){
,filter = parents.attr('lay-filter'); ,filter = parents.attr('lay-filter');
if(li.hasClass(THIS)){ if(li.hasClass(THIS)){
if(li.next()[0]){ if (li.next()[0] && li.next()[0].tagName === 'LI'){
call.tabClick.call(li.next()[0], null, index + 1); call.tabClick.call(li.next()[0], null, index + 1);
} else if(li.prev()[0]){ } else if (li.prev()[0] && li.prev()[0].tagName === 'LI'){
call.tabClick.call(li.prev()[0], null, index - 1); call.tabClick.call(li.prev()[0], null, index - 1);
} }
} }

Loading…
Cancel
Save