2011-03-03 73 views
0

我有兩個jQuery(可以增加),其中一個masterpage和另一個是在contentpage ...首先我添加了contentpage查詢(它是一個水平的手風琴菜單),它工作完美,然後我需要第二個一個(讓可摺疊面板標題位置)的母版...倒是後第二次,他們都沒有工作......究竟是什麼問題...兩個jquery不工作

樣本代碼

這是第一次加入到在我的內容頁面中製作橫向手風琴菜單:

 <script src="jquery.zaccordion.js" type="text/javascript"></script> 
     <script src="jquery.easing.1.3.js" type="text/javascript"></script> 
     <script src="jquery-1.4.2.min.js" type="text/javascript"></script> 
     <script src="jquery.zaccordion.min.js" type="text/javascript"></script> 


/*In MasterPage to Horizontal accordion*/ 
<script src="http://code.jquery.com/jquery-1.5.js" type="text/javascript"> 
/*Second query plugin*/ 

<script type="text/javascript"> 
     $(document).ready(function() { 
      $("#featured").zAccordion({ 
       width: 600, 
       height: 260, 
       tabWidth: 75 
      }); 
     }); 
    </script> 

秒添加的代碼來改變根據展開可摺疊的面板和崩潰的標題面板的位置..

<script src="http://code.jquery.com/jquery-1.5.js" type="text/javascript"> 
     $(document).ready(function() { 
      var bodyHeight = $(document).height(); 
      var panelHeight = $('#pnlSearchContent').height(); --CP content panel height 
      var panelHeightPosition = bodyHeight - panelHeight; 
      $('#pnlSearchTitle').offset().top = panelHeightPosition; -- CP Title panel final position 
     }); 
    </script> 
+0

你在引用jQuery文件兩次嗎? – rahul 2011-03-03 12:38:23

+3

你可以發佈這兩個腳本,讓人們可以看到你在做什麼? – 2011-03-03 12:38:57

+1

我們不能給你的解決方案,直到你可以給出具體的錯誤消息和/或代碼示例 – JohnP 2011-03-03 12:39:05

回答

1

只需刪除從您的代碼<script src="jquery-1.4.2.min.js" type="text/javascript"></script>,你已經包括jquery-1.5.js從外部網站。

2

似乎使用的是2個jQuery插件和包括Jquery的JS文件兩次(一次對每個插件)

您必須只包含jquery js文件一次,這兩個插件js文件都將使用該文件。

當你查看源代碼,你的HTML應該是這樣的:

//this is the actual jquery javascript file. 
<script type="text/javascript" src="jquery.min.js"></script> 

<script type="text/javascript" src="Plugin-1.js"></script> 

<script type="text/javascript" src="Plugin-2.js"></script> 

感謝

+0

thx @goths ..但有沒有兩次相信我,我編輯問題(再次)添加插件, – 2011-03-03 13:04:31