扰流器显示代码

时间:2012-07-19 14:55:11

标签: javascript

我在此页面中有关于您的剧透的问题:

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>

1 个答案:

答案 0 :(得分:1)

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

该部分找到所有不是当前(点击)的部分并隐藏它们。