2012-07-19 71 views
0

我有一個問題,關於你的擾流板在此頁:
擾流板顯示代碼

http://jdownloader.org/download/index

當我點擊的Windows出現一個表,但是當我點擊的Linux的Windows 的內容消失。我想創建一個這樣的劇透,但一個擾流板的內容不會消失當我按另一個擾流板。

這段代碼究竟應該改變什麼(html源代碼)?

<div class="dokuwiki"> 
     <div class="right_page"> 
<div class="entry-content"> 
<script type="text/javascript" src="./JDownloader.org - Official Homepage_files/jquery.js"></script> 
<script type="text/javascript">           
$(document).ready(function(){ 
$(".nonjs").removeAttr("href"); //href is needed for users without JS 
$('.OS').click(function(){ 
if($(this).find(".details").is(":visible")) 
{ 
    $(this).find(".details").not(":hidden").hide("slow"); 
    return true; 
} 
else 
{ 
    $(".OS").not(this).each(function(i) { 
    $(this).find(".details").hide("slow"); 
    }); 
    $(this).find(".details").show("slow"); 
    return false; 
} 
}); 
}); 
</script>  
<style type="text/css"> 
<!-- 
.details { 
display: none; 
clear: both; 
padding: 2px; 
} 
.nonjs{ 
    cursor:pointer; 
} 
img { 
border: 0px; 
} 
--> 
</style> 
+0

歡迎來到SO。我注意到你剛纔還有其他問題,但你還沒有接受答案。如果答案解決了您的問題,您應該[接受](http://meta.stackexchange.com/a/5235/188347)。 – sachleen 2012-07-19 15:00:43

回答

1
$(".OS").not(this).each(function(i) { 
    $(this).find(".details").hide("slow"); 
}); 

那部分找到所有不屬於當前(點擊)一個隱藏他們的人。

+0

謝謝sachleen,我試圖取消,現在它工作 – user143822 2012-07-19 15:02:46

+0

我有這個代碼的另一個問題。當我點擊**下面**擾流板(我有鏈接)不是擾流板(Windows)擾流板消失,雖然我沒有點擊擾流板..爲什麼?點擊(function(){** ? – user143822 2012-07-19 16:18:28

+0

這是因爲你仍然在'.OS'容器中單擊,而是改變你的選擇器,使它只顯示/隱藏當你點擊圖像 – sachleen 2012-07-19 16:30:42