var t = n =0, count;
$(document).ready(function(){
count=$("#banner_list a").length;
counts=$("#banner_bg a").length;
$("#banner_bg a:not(:first-child)").hide();
$("#banner_list a:not(:first-child)").hide();
$("#banner_info").click(function(){
window.open($("#banner_list a:first-child").attr('href'), "_self");
window.open($("#banner_bg a:first-child").attr('href'), "_self");
});
$("#banner_info li").click(function() {
var i = $(this).text() -1;//获取Li元素内的值,即1,2,3,4
n = i;
if (i >= count) return;
$("#banner_info").unbind().click(function(){
window.open($("#banner_list a").eq(i).attr('href'), "_self");
window.open($("#banner_bg a").eq(i).attr('href'), "_self");
});
$("#banner_bg a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(500);
$("#banner_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(500);
document.getElementById("banner_list").style.background="";
document.getElementById("banner_bg").style.background="";
$(this).toggleClass("curr");
$(this).siblings().removeAttr("class");
});
t = setInterval("showAuto()", 4000);
$("#banner").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 4000);});
});
function showAuto()
{
n = n >=(count -1) ?0 : ++n;
$("#banner li").eq(n).trigger('click');
}
这是代码,在ie下 图片自动变的时候url就http://localhost:8080//index/undefined变成404了