點擊後,我的功能隱藏前兩個DIV
s並切換第三個DIV
。這是行得通的。當我再次點擊相同的鏈接時,該功能切換回第三個DIV
,這也起作用。但之前隱藏的兩個DIV
現在仍處於隱藏狀態,應該可見。隱藏兩個DIV並點擊三分之一,然後反轉
<div>
<div id="one"></div>
<div id="two"></div>
<div id="three"></div> -->CSS style is hidden
</div>
$(document).ready(function(){
$("#three").hide();
$(".show_hide").show(); --> this shows my click link
$('.show_hide').click(function(){
$("#three").slideToggle().load('testpage.php');
$("#one").hide();
$("#two").hide();
})
});
請不要只提供一個鏈接到jsFiddle,也可以將代碼添加到答案中。 – Gabe 2011-12-20 17:58:18