2017-11-11 24 views
1

它上線的站點的例子 is herejQuery的切換時間不設置

JS腳本我有工作在這裏:

$(document).ready(function() { 
    $('.hideData').hide(); 

    $('.toggleButton').click(function() { 
     $(this).next().toggle(1000); 
    }); 
}); 

的HTML文檔包括PHP代碼,但是它不」牛逼渲染時對標題按鈕點擊我已經通過股利.toggleButton

<div class='toggleButton'> 
<h1 class='head-font text-center head'>$result_array[$j]</h1> 
</div> 
<div class='hideData'> 
<table class='table table-hover table-responsive'> 
<thead> 
    <tr> 
    <th>Item</th> 
    <th class='text-right'>Price</th> 
    </tr> 
</thead> 
<tbody> 

    <tr> 
    <td>" . $name . " - <small>" . $description . "</small></td> 
    <td class='text-right'>£" . $price . "</td> 
    </tr> 

</tbody> 

成立

無論我將哪些數字或速度放入切換,它都不會改變速度或動畫?

+1

代碼[這裏工作正常(https://jsfiddle.net/ nqh6nb7g /)和更改持續時間可提供預期結果 – charlietfl

回答

0

您的網站正在兩次添加jQuery,即使這兩個文件聲稱是v3.2.1,腳本的內容也不相同。您有:

  • jQuery的3_002.js
  • jQuery的3.js

前者是好的。如果刪除腳本標籤在你的HTML jQuery的3.js並重新加載頁面,動畫延遲將開始工作:

顯示
<script src="Menu%20-%20The%20Old%20Thatch%20Inn_files/jquery-3.js"></script> 
+0

感謝您的支持! –