Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JQuery不适用于IE,但适用于Chrome和firefox_Jquery_Internet Explorer - Fatal编程技术网

JQuery不适用于IE,但适用于Chrome和firefox

JQuery不适用于IE,但适用于Chrome和firefox,jquery,internet-explorer,Jquery,Internet Explorer,我必须开发一个应用程序,其中的一部分是iquiry,但我不熟悉它。 当鼠标悬停在地图上并更改地图的背景色和链接颜色时,必须执行该代码。它可以在Chrome和Firefox中使用,但在Inernet Exlporer中没有效果。 请帮忙 这是我的密码: <script type="text/javascript" > try{ jQuery(document).ready(function () { $.fn.maphilight.defaults = {

我必须开发一个应用程序,其中的一部分是iquiry,但我不熟悉它。 当鼠标悬停在地图上并更改地图的背景色和链接颜色时,必须执行该代码。它可以在Chrome和Firefox中使用,但在Inernet Exlporer中没有效果。 请帮忙

这是我的密码:

<script type="text/javascript" >
try{
    jQuery(document).ready(function () {

        $.fn.maphilight.defaults = {
            fill: true,
            fillColor: '008000',
            fillOpacity: 0.8,
            stroke: false,
            strokeColor: 'ff0000',
            strokeOpacity: 1,
            strokeWidth: 1,
            fade: true,
            alwaysOn: false,
            neverOn: false,
            groupBy: false
        };
        $(".main-menu").mouseover(function () {
            alert('go');
            var himg = $(this).attr('himg')
            $(this).children().attr('src', himg)
        });

        $(".main-menu").mouseout(function () {
            var nimg = $(this).attr('nimg')
            $(this).children().attr('src', nimg)
        });

        $("a.fancybox").fancybox({
            'titlePosition': 'inside'
        });

        $("a.iframe").click(function () {
            $.fancybox({
                'padding': 0,
                'margin': 0,
                'autoScale': false,
                'transitionIn': 'none',
                'transitionOut': 'none',
                'width': 980,
                'height': 575,
                'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
                'type': 'iframe'
            })
            return false;
        });

        $('#photos').galleryView({
            panel_width: 900,
            panel_height: 300,
            frame_width: 160,
            frame_height: 110
        }); 
        $("#one").sexyCombo({
            emptyText: "Select"
        });
        $("#two").sexyCombo({
            emptyText: "Select"
        });
        $("#three").sexyCombo({
            emptyText: "Select"
        });

    }); 
    }
catch (err)
 {
    alert(err);
 }
</script>

试一试{
jQuery(文档).ready(函数(){
$.fn.maphilight.defaults={
填充:是的,
fillColor:'008000',
填充不透明度:0.8,
笔画:错,
strokeColor:'ff0000',
频闪不透明度:1,
冲程宽度:1,
是的,
奥尔韦森:错,
奈维隆:错,
groupBy:false
};
$(“.main menu”).mouseover(函数(){
警惕(‘go’);
var himg=$(this.attr('himg'))
$(this.children().attr('src',himg)
});
$(“.main menu”).mouseout(函数(){
var nimg=$(this.attr('nimg'))
$(this.children().attr('src',nimg)
});
$(“a.fancybox”)。fancybox({
“标题位置”:“内部”
});
$(“a.iframe”)。单击(函数(){
$.fancybox({
“填充”:0,
“边距”:0,
“自动缩放”:false,
“transitionIn”:“无”,
“transitionOut”:“无”,
“宽度”:980,
‘高度’:575,
'href':this.href.replace(新的RegExp(“watch\\?v=,“i”),'v/'),
“type”:“iframe”
})
返回false;
});
$(“#照片”)。galleryView({
面板宽度:900,
面板高度:300,
框架宽度:160,
车架高度:110
}); 
美元(“#一”)。sexyCombo({
清空文本:“选择”
});
美元(“#两”)。sexyCombo({
清空文本:“选择”
});
美元(“#三”).sexyCombo({
清空文本:“选择”
});
}); 
}
捕捉(错误)
{
警惕(err);
}

删除
重试catch
呼叫。你似乎真的不需要它,这在IE中引起了攻击。

原始代码没有try-catch,我添加了这个用于捕获错误,但无法捕获它。因此,我认为试捕不是理由。