このサイトでは、jquery を 2 つ使用しています。1 つは「何でもスライダー」用で、もう 1 つは非表示の切り替え用です。
トグルのjqueryへのリンクを削除すると、スライダーは機能しますが、トグルは機能しません...これはトグルのjqueryへのリンクです。
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
両方をうまく機能させて遊ぶ方法を知っている人はいますか?
ありがとう
コードの完全な部分は次のとおりです。
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
<script>
$(document).ready(function() {
$('.nav-toggle').click(function(){
//get collapse content selector
var collapse_content_selector = $(this).attr('href');
//make the collapse content to be shown or hide
var toggle_switch = $(this);
$(collapse_content_selector).toggle(function(){
if($(this).css('display')=='none'){
toggle_switch.html('Learn More');//change the button label to be 'Show'
}else{
toggle_switch.html('Condense');//change the button label to be 'Hide'
}
});
});
});
</script>