[solved] mootools - prototype

here you will find only solved Help topics

Moderator: 1.2 Moderators

[solved] mootools - prototype

Postby frankenstein on Mon Jun 08, 2009 5:30 am

Hi there,

Here’s a simple code that let me click everywhere on the page and, if i directly click on paragraphs, hides them.

  1.  
  2. Event.observe(document.body, 'click', function(event) {
  3.   var element = Event.element(event);
  4.   if ('P' == element.tagName)
  5.     element.hide();
  6. });
  7.  


Is there any way of doing this on moo? I have tryed different ways of doing this, but no success.

Regards
frankenstein
 
Posts: 2
Joined: Sat Nov 01, 2008 10:10 am

Re: mootools - prototype

Postby horseweapon on Mon Jun 08, 2009 10:05 pm

  1.  
  2. $(document.body).addEvent('click',function(event){
  3.     var el = $(event.target);
  4.     if(el.match('p')){
  5.         el.setStyle('display','none');
  6.     }
  7. });
  8.  
User avatar
horseweapon
mootools enthusiast
 
Posts: 393
Joined: Mon Aug 04, 2008 6:52 pm
Location: France

[solved] mootools - prototype

Postby frankenstein on Sat Jun 27, 2009 12:11 pm

Hi there,

Yes! it worked perfectly. Thank you very much.

Regards
frankenstein
 
Posts: 2
Joined: Sat Nov 01, 2008 10:10 am


Return to Solutions

Who is online

Users browsing this forum: No registered users and 3 guests