2012-08-08 51 views
0

我使用this scripton my site here.,但因爲jscript設置爲列表項ID,我不太確定如何安全地更改爲div。需要將列表項目更改爲div的jquery選項卡式內容

這是非常簡單的我知道,所以任何能夠指導我的人將不勝感激!

所有的代碼是在原頁面上的高度調整位是這樣的:

// Adjust outer wrapper to fit new list snuggly 
var newHeight = base.$el.find("#"+listID).height(); 
$allListWrap.animate({ 
    height: newHeight 
}); 

我只是改變了列表項目的div和PS:

<div class="list-wrap"> 
     <div id="featured"> 
      <p>Stuff in here!</p> 
     </div> 
     <div id="core" class="hide"> 
      <p>hello</p> 
     </div> 
     <div id="jquerytuts" class="hide"> 
      <p>Stuff in here!</p> 
     </div> 
     <div id="classics" class="hide"> 
      <p>Stuff in here!</p> 
     </div> 
     <div id="link" class="hide"> 
      <p>Stuff in here!</p> 
     </div> 
</div> <!-- END List Wrap --> 

如果有誰知道並可以幫助那會很好..

回答

0
hai now check work correctly. 
copy and paste your code and run your system. 





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Untitled Document</title> 
<script> 

      var newHeight = base.$el.find("#"+listID).height(); 
       $allListWrap.animate({ 
        height: newHeight 
       }); 

</script> 
<style> 
div p 
{ 
    margin:0px; 
    padding:5px 0px 0px 0px; 

} 
</style> 
</head> 

<body> 
<div class="list-wrap"> 

     <div id="featured"> 
      <p>Stuff in here!</p> 
     </div> 

     <div id="core" class="hide"> 
      <p>hello</p> 
     </div> 

     <div id="jquerytuts" class="hide"> 
      <p>Stuff in here!</p> 
     </div> 

     <div id="classics" class="hide"> 
      <p>Stuff in here!</p> 
     </div> 

     <div id="link" class="hide"> 
      <p>Stuff in here!</p> 
     </div> 

</div> <!-- END List Wrap --> 

</body> 
</html> 
相關問題