<script type="text/javascript">
$(function(){
$('#maintabs').tabp();
})
</script>
(function($) {
$.fn.tabp = function(){
self = this;
thisId = $(self).attr('id');
tClass = '.' + thisId;
tab = '#' + thisId + ' ' + '.tab';
tabp = tClass + ' .tab-p';
$(document).on('click',tab,function(){
$(tab).removeClass('active');
$(this).addClass('active');
$(tabp).removeClass('active');
$('#' + $(this).data('tab')).addClass('active');
});
};
})(jQuery);
如上面的代码,在非IE的浏览器中,$(document).on('click',tab,function(){ 这个绑定是可以的,但在IE中(测试了789),这个绑定无效,点击了绑定的对象也没有反应。。
应该怎么改?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
self 前面加个var