javascript
  • html
  • css
  • 2013-07-09 99 views -1 likes 
    -1

    所以我的JavaScript已莫名其妙地停止工作。我不太確定我做了什麼,但任何幫助將不勝感激。謝謝!我真的應該用VC,我想這是敲響了警鐘Javascript停止激活

    <head style="overflow-x: hidden"> 
        <title>Dupont Studios</title> 
        <link href='http://fonts.googleapis.com/css?family=Oxygen:300' rel='stylesheet' type='text/css'> 
        <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> 
        <script type="text/javascript" src="waypoints.js"></script> 
        <script type="text/javascript" src="jquery-1.9.1.js"></script> 
    
        <meta name="viewport" content="width=device-width, initial-scale=1"> 
        <link rel="stylesheet" media="only screen and (max-width: 400px)" href="mobile.css" /> 
        <link rel="stylesheet" media="only screen and (min-width: 401px)" href="style.css" /> 
        <script language="javascript" type="text/javascript"> 
         $(function() { 
         // Do our DOM lookups beforehand 
         var nav_container = $(".nav-container"); 
         var nav = $("nav"); 
         nav_container.waypoint({ 
         handler: function(direction) { 
         nav_container.toggleClass('sticky', direction=='down'); 
    
         } 
         }); 
         }); 
    
        </script> 
        <script language="javascript" type="text/javascript"> 
         $("li.nav-item").click(function() { 
         $("html, body").animate({ 
         scrollTop: $($(this).children().attr("href")).offset().top + "px"}, {duration: 500, easing: "swing" 
         }); 
         return false; 
         }); 
    
        </script> 
    </head> 
    

    錯誤:

    Uncaught ReferenceError: jQuery is not defined jquery-ui.js:351 
    Uncaught TypeError: undefined is not a function waypoints.js:25 
    Uncaught TypeError: Object [object Object] has no method 'waypoint' 
    
    +3

    你會得到什麼錯誤?你正在用開發人員工具進行調試嗎? – j08691

    +0

    當您使用任何網絡軟件時,您應該始終打開開發者控制檯。即使你不知道錯誤意味着什麼,發生這種錯誤對幫助這裏的人會有巨大的幫助。 – Pointy

    +0

    對不起,現在更新錯誤 – nictoriousface

    回答

    -1

    其中一個原因可能是你已經從你的瀏覽器中禁用JavaScript的..發現它在設置您的瀏覽器並激活JavaScript。

    你的錯誤後,它看起來像語法錯誤是在jquery ui文件中,請將其替換爲最新的一個,並試試看。

    +0

    你一定是在開玩笑 – ElmoVanKielmo

    1

    的錯誤是在這裏:

    nav_container.waypoint 
    

    有jQuery的收集都沒法waypoint

    而且jquery-ui應該放在jQuery之後。

    現在的最後一個錯誤是在第25行的waypoints.js - 您正試圖調用一些尚未定義的函數。

    3

    你需要加載第一個jQuery然後jquery ui然後路點

    +0

    工作!以及有點,粘頭正在工作,但現場滾動仍然似乎是搞砸 – nictoriousface

    +0

    我的答案包含此信息之前1分鐘... – ElmoVanKielmo

    相關問題