那那哥 2017-06-28 01:03 采纳率: 100%
浏览 2080
已采纳

jq在IE11中不加载,其他浏览器下正常

用JQ做的导航在其他浏览器下正常,在IE下没有效果是哪里出问题了?
$(function(){
$(".find_nav_list").css("left",sessionStorage.left+"px");
$(".find_nav_list li").each(function(){
if($(this).find("a").text()==sessionStorage.pagecount){
$(".sideline").css({left:$(this).position().left});
$(".sideline").css({width:$(this).outerWidth()});
$(this).addClass("find_nav_cur").siblings().removeClass("find_nav_cur");
navName(sessionStorage.pagecount);
return false
}
else{
$(".sideline").css({left:0});
$(".find_nav_list li").eq(0).addClass("find_nav_cur").siblings().removeClass("find_nav_cur");
}
});
var nav_w=$(".find_nav_list li").first().width();
$(".sideline").width(nav_w);
$(".find_nav_list li").on('click', function(){
nav_w=$(this).width();
$(".sideline").stop(true);
$(".sideline").animate({left:$(this).position().left},300);
$(".sideline").animate({width:nav_w});
$(this).addClass("find_nav_cur").siblings().removeClass("find_nav_cur");
var fn_w = ($(".find_nav").width() - nav_w) / 2;
var fnl_l;
var fnl_x = parseInt($(this).position().left);
if (fnl_x <= fn_w) {
fnl_l = 0;
} else if (fn_w - fnl_x <= flb_w - fl_w) {
fnl_l = flb_w - fl_w;
} else {
fnl_l = fn_w - fnl_x;
}
$(".find_nav_list").animate({
"left" : fnl_l
}, 300);
sessionStorage.left=fnl_l;
var c_nav=$(this).find("a").text();
navName(c_nav);
});
var fl_w=$(".find_nav_list").width();
var flb_w=$(".find_nav_left").width();
$(".find_nav_list").on('touchstart', function (e) {
var touch1 = e.originalEvent.targetTouches[0];
x1 = touch1.pageX;
y1 = touch1.pageY;
ty_left = parseInt($(this).css("left"));
});
$(".find_nav_list").on('touchmove', function (e) {
var touch2 = e.originalEvent.targetTouches[0];
var x2 = touch2.pageX;
var y2 = touch2.pageY;
if(ty_left + x2 - x1>=0){
$(this).css("left", 0);
}else if(ty_left + x2 - x1<=flb_w-fl_w){
$(this).css("left", flb_w-fl_w);
}else{
$(this).css("left", ty_left + x2 - x1);
}
if(Math.abs(y2-y1)>0){
e.preventDefault();
}
});
});

  • 写回答

1条回答 默认 最新

  • CN-cheng 2017-06-28 01:07
    关注

    应该是报错了 你看下console

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办