0
该脚本工作得很好,但IE浏览器给我的错误“完成,但页面出现错误”,我不明白为什么。任何人都可以告诉我这个脚本有什么问题吗?
(function($){
$.fn.extend({
tabify: function() {
function getHref(el){
hash = $(el).find('a').attr('href');
if(hash)
return hash.substring(0,hash.length-4);
else
return false;
}
function setActive(el){
$(el).addClass('active');
if(getHref(el))
$(getHref(el)).show();
else
return false;
$(el).siblings('li').each(function(){
$(this).removeClass('active');
$(getHref(this)).hide();
});
}
return this.each(function() {
var self = this;
$(this).find('li>a').each(function(){
$(this).attr('href',$(this).attr('href') + '-tab');
});
function handleHash(){
if(location.hash)
setActive($(self).find('a[href=' + location.hash + ']').parent());
}
if(location.hash)
handleHash();
setInterval(handleHash,100);
$(this).find('li').each(function(){
if($(this).hasClass('active'))
$(getHref(this)).show();
else
$(getHref(this)).hide();
});
});
}
});
})(jQuery);
点击它并找出错误是什么? – Matchu 2010-12-06 13:27:47
使用错误控制台(或IE中的黄色感叹号)来查找哪些错误*您实际获得哪些错误 – 2010-12-06 13:28:11