qq_20898003 2016-04-29 02:47 采纳率: 0%
浏览 1206

js图片轮番IE兼容性问题

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了
  • 写回答

1条回答 默认 最新

  • qq_20898003 2016-04-29 03:32
    关注
                    <div class="mMiddleMode_bd ymlsk_height" id="banner_info">
                        <div class="mSlider" id="banner_list">
                        <div id="newPic"></div>
    
                        </div>
                        <ul class="mSlider_nav">
                            <li class="curr">1</li>
                            <li>2</li>
                            <li>3</li>
                            <li>4</li>
                        </ul>
                    </div>
                </div>
    
                                这是html.来大神啊!!!!!!!!!!!!!!!!
    
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?