Jquery、Javascript 點擊菜單在 IE 和 Safari 上不起作用 (Jquery, Javascript click menu doesnt work on IE and Safari)


問題描述

Jquery、Javascript 點擊菜單在 IE 和 Safari 上不起作用 (Jquery, Javascript click menu doesnt work on IE and Safari)

我創建了這個小菜單 demo,它在 firefox 和 Chrome 上運行良好。但是函數 (".class").cick(function() 在 IE 和 Safari 上什麼都不做。也許有人可以幫忙?我試過 .live .on("click",".class") 等等。沒有任何效果. 你需要像 這個

代碼(Javascript)

  /*Desktopvariante*/
if ((($(window).width() > 970) && test == 90) || (($(window).width() > 970))) {

    $(function () {

        $(".ClickLevel1").click(function () {    


            $(this).addClass("activeFarbe");                

            $(".navLevel1").addClass("activePfeil", 400);

            $("#listLevel1").show("slide", {direction: "right"}, 350);
            return false;
        });

    });



    $(function () {
        $(".ClickLevel2").click(function () {


            $(this).addClass("activeFarbe");     

            $(".navLevel2").addClass("activePfeil",400);


            $("#listLevel2").show("slide", {direction: "right"}, 350);
            return false;
        });


    });

    $(function () {
        $(".ClickLevel3").click(function () {

            $(this).addClass("activeFarbe");   

            $(".navLevel3").addClass("activePfeil",400);


            $("#listLevel3").show("slide", {direction: "right"}, 350);
            return false;
        });
    });


}

}


參考解法

方法 1:

problem solved (screen.orientation.angle) cant be read by safari and IE

(by maxal95maxal95)

參考文件

  1. Jquery, Javascript click menu doesnt work on IE and Safari (CC BY‑SA 2.5/3.0/4.0)

#safari #jquery #javascript #html #internet-explorer






相關問題

如何讓 <asp:menu> 在 Safari 中工作? (How can I get <asp:menu> working in Safari?)

jQuery 航點在 Safari 中不起作用 (jQuery waypoints not working in Safari)

iOS WebApp 不顯示啟動圖像 (iOS WebApp not showing startup image)

Jquery、Javascript 點擊菜單在 IE 和 Safari 上不起作用 (Jquery, Javascript click menu doesnt work on IE and Safari)

如果我沒有 Mac 和 Safari,我將如何重現 Javascript 錯誤? (How am I going to reproduce Javascript bugs if I don't have a Mac & Safari?)

Webkit 中的全局 Javascript 變量 (Global Javascript variables in Webkit)

Safari IndexOutOfRangeException (safari IndexOutOfRangeException)

Safari 2.0 中修改鍵的鍵盤事件 (Keyboard Events for Modifier Keys in Safari 2.0)

通過 HTML 在 Mobile Safari 上實現 UIPickerview (Implement UIPickerview on Mobile Safari via HTML)

Safari 的 jQuery 問題 (jQuery problem with Safari)

網頁上的音頻被截斷 (Audio cuts out on webpages)

當選項卡不活動時,保持 JS/jQuery 代碼在 Safari 中工作 (Keep the JS/jQuery code working in Safari when the tab is not active)







留言討論