0
我發現這script(更多/更少的文本)。當我用jQuery lib 1.11編寫代碼時,他不工作。我不知道爲什麼?jQuery最新的庫不工作腳本
代碼:
<span class="teaser">text goes here</span>
<span class="complete"> this is the complete text being shown</span>
<span class="more">more...</span>
的jQuery:
$(".more").toggle(function(){
$(this).text("less..").siblings(".complete").show();
}, function(){
$(this).text("more..").siblings(".complete").hide();
});
可以尋求幫助?謝謝
瀏覽器的JavaScript控制檯中是否有錯誤?什麼「不起作用?」意思是說,具體?哦,並且['toggle()'](http://api.jquery.com/toggle-event/)在jQuery 1.9中被刪除;所以*應該*是錯誤。 – 2014-09-29 11:52:58
請參閱http://stackoverflow.com/a/14383246/128165瞭解不推薦使用的'toggle'方法的實現。 – 2014-09-29 12:14:41