Paul
Paul

Reputation: 858

trying to show/hide a div but something is not working

window.addEvent('domready', function(){ 

 $('detail_block_table').addEvent('click', function(){

      if ($('detail_showDiv').getStyle('display') == 'none')
      {
          $('detail_showDiv').setStyle('display','block');
      }
      else
      {     
          $('detail_showDiv').setStyle('display','none');
      }

   });

});

This is the code, it looks fine but something prevents it from working.

Any ideas?

Upvotes: 0

Views: 208

Answers (1)

npup
npup

Reputation: 2541

Since you are using mootools, why not simply do $('detail_showDiv').toggle(); in your click handler?
Check it out in the mootools docs.

Upvotes: 2

Related Questions