2011-06-27 50 views
0

我有這樣的代碼: 它不會工作我下載的包括需要但沒有結果,我應該把代碼?我認爲投放地點有問題問題與Jquery/lavalamp(新手)

<html> 
<head> 
<script type="text/javascript" src="jquery-latest.pack.js"></script> 
<script type="text/javascript" src="jquery.lavalamp.js"></script> 
<script type="text/javascript" src="jquery.easing.js"></script> 

<script type="text/javascript"> 
    $(function() { $(".lavaLamp").lavaLamp({ fx: "backout", speed: 700 })}); 
</script> 
<style> 
/* Styles for the entire LavaLamp menu */ 
.lavaLamp { 
    position: relative; 
    height: 29px; width: 421px; 
    background: url("../image/bg.gif") no-repeat top; 
    padding: 15px; margin: 10px 0; 
    overflow: hidden; 
} 
    /* Force the list to flow horizontally */ 
    .lavaLamp li { 
     float: left; 
     list-style: none; 
    } 
     /* Represents the background of the highlighted menu-item. */ 
     .lavaLamp li.back { 
      background: url("../image/lava.gif") no-repeat right -30px; 
      width: 9px; height: 30px; 
      z-index: 8; 
      position: absolute; 
     } 
      .lavaLamp li.back .left { 
       background: url("../image/lava.gif") no-repeat top left; 
       height: 30px; 
       margin-right: 9px; 
      } 
     /* Styles for each menu-item. */ 
     .lavaLamp li a { 
      position: relative; overflow: hidden; 
      text-decoration: none; 
      text-transform: uppercase; 
      font: bold 14px arial; 
      color: #fff; outline: none; 
      text-align: center; 
      height: 30px; top: 7px; 
      z-index: 10; letter-spacing: 0; 
      float: left; display: block; 
      margin: auto 10px; 
     } 

</style> 

</head> 
<body> 
<form>   
<ul class="lavaLamp"> 
      <li><a href="#">Home</a></li> 
      <li><a href="#">Plant a tree</a></li> 
      <li><a href="#">Travel</a></li> 
      <li><a href="#">Ride an elephant</a></li> 
     </ul> 
    <li class="back"><div class="left"></div></li> 
</form> 
</body> 
</html> 
+0

你的意思是說JS文件不加載?也許你應該從CDN鏈接到它們,如下所示:http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery –

+0

它會在頁面中顯示我什麼都不會看到我只是看到一個點 – Nickool

+0

我想運行這個代碼網站:http://www.gmarwaha.com/blog/category/client-side/jquery/#tb – Nickool

回答

1

您的HTML代碼存在錯誤。您不需要該行

<li class="back"><div class="left"></div></li> 

該行由lavalamp插件生成,因此將其刪除。