[wp-trac] [WordPress Trac] #10508: Javascript show/hide not working in WP 2.8 widget section

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 29 06:16:29 UTC 2009


#10508: Javascript show/hide not working in WP 2.8 widget section
--------------------------+-------------------------------------------------
 Reporter:  namus25       |       Owner:  azaozz    
     Type:  defect (bug)  |      Status:  new       
 Priority:  high          |   Milestone:  Unassigned
Component:  JavaScript    |     Version:  2.8.1     
 Severity:  blocker       |    Keywords:            
--------------------------+-------------------------------------------------
 I'm using a simple javascript to show/hide some content in the widget
 section of wordpress  2.8.2. But the show hide functionality doesn't work
 at all. Below is the code I used in  widget:

 <a href='toggleME()'>Toggle</a>
 <div id='div1' style='display:none'>Show/Hide Me</div>
 <script>
 function toggleME(){
 var div1 = document.getElementById('div1');
 if (div1.style.display == 'none') {
 div1.style.display = 'block';
 } else {
 div1.style.display = 'none';
 }
 }
 </script>

 You can also download a sample plugin here to test with:
 <a
 href="http://www.maxblogpress.com/temp/widget2.8.zip">http://www.maxblogpress.com/temp/widget2.8.zip</a>

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10508>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list