2014-10-02 24 views
-3
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> 
    <head> 
     <script type="text/javascript"></script> 
     <script src="jquery-1.11.1.js"></script> 
     <style type="text/css"> 
      button.allbut{ 
      background: none;text-shadow: none;margin:0,0,0,0;padding:0,0; 
      border-radius: 0px;color: blue;font-size: 100%; 
      font-family: Georgia, serif; text-decoration: none; 
      vertical-align: left;background: white; 
      border: none;text-align: center; 
      } 
      .showTopicbox{ 
      padding:0%,0%,0%,0%;margin:0%;border:0.1px red;width:50%;height:auto; 
      background-color:white;color:black; 
      } 
     </style> 
     <title>puff4</title> 
    </head> 
    <body> 
     <button class="allbut" id="usinglabels">Using labels</button> 
     <div id="usinglabels" class="showTopicbox">Some 
      nice Queen's english here 
      ...The property returns or sets a value that specifies which item in a 
      ListBox control is displayed in the topmost position, commonly used to 
      scroll Some nice Queen's english here 
      ...The property returns or sets a value that specifies which item in a 
      ListBox control is displayed in the topmost position, commonly used to 
      scroll 
     </div> 
     <button class="allbut" id="connecting">Connecting</button> 
     <div id="connecting" class="showTopicbox">Some 
      nice Queen's english here 
      ...The property returns or sets a value that specifies which item in a 
      ListBox control is displayed in the topmost position, commonly used to 
      scroll Some nice Queen's english here 
      ...The property returns or sets a value that specifies which item in a 
      ListBox control is displayed in the topmost position, commonly used to 
      scroll 
     </div> 
     <script type="text/javascript"> 
      $("#usinglabels").click(function() {$('#usinglabels').slideToggle(0);}); 
      $("#connecting").click(function() {$('#connecting').slideToggle(0);}); 
     </script> 
    </body> 
</html> 
+0

'id's在文檔中必須是唯一的。 – Teemu 2014-10-02 18:06:15

回答

1

ids不應重複。

<button class="allbut" id="usinglabels">Using labels</button> <-- id 
<div id="usinglabels" class="showTopicbox">Some <--same id 
$('#usinglabels').slideToggle(0); <--what am I supposed to select? 

更改您試圖隱藏的部分的ID。

相關問題