2015-11-04 69 views
-3

我正在使用記事本++的Jquery,除了腳本部分之外,所有東西都被執行了。我不知道它是瀏覽器問題還是記事本++問題或者我的程序問題。請幫助我。這是我的代碼:我無法得到jQuery的輸出..!請幫幫我..!

<!DOCTYPE html> 
    <html> 
    <head> 
    <meta charset="utf-8"> 
    <title>in-Quiz-itive</title> 

      <script> 
     $(document).ready(function() 
     { 

      $('div').mouseenter(function() 
       { 
        $('div').fadeTo('fast',1);  

       }); 
      $('div').mouseleave(function() 
       { 
        $('div').fadeTo('fast',0.5); 
       }); 
     }); 
      </script> 
      <style> 
      img{ 
      position:fixed; 
      width:100%; 
      top:0px; 
      left:0px; 
      } 
      div { 
      height: 60px; 
      width: 100px; 
      border-radius: 5px; 
      background-color: #69D2E7; 
      text-align: center; 
      font-family: Verdana, Arial, Sans-Serif; 
      opacity: 0.5; 
} 
      </style> 

    </head> 

    <body> 
      <img src="burra.jpg"> 
      <div> 
       <strong>Click Here</strong> 
      </div> 

    </body> 
</html> 
+2

你沒有jQuery .. – Nick

+0

而且根本不需要JavaScript,因爲CSS可以做那個動畫 – epascarello

+0

請看[問]看看如何編寫一個很好的問題,其中包括[mcve]。 –

回答

0

您沒有在您的HTML代碼中包含jQuery腳本。您可以輕鬆地做到這一點,包括之前的任何腳本的這個片段:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> 

此處瞭解詳情:https://developers.google.com/speed/libraries/

0

您需要包括jQuery的在頭部分HTML文件

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 
+0

這使用舊版本的jQuery。 – 2015-11-04 18:55:08