Posted By

1man on 10/29/07


Tagged

javascript slide mootools


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

tivi
vali29
stephenns
joshontheweb


Mootools Slide Toggle


 / Published in: JavaScript
 

Very basic way to toggle an element to slide in and out using mootools 1.1. Uses FX.Slide, other transitions are available.

  1. function toggleSlide(){
  2. //Select the element you wish to slide
  3. var mySlide = new Fx.Slide('slide');
  4.  
  5. //Create a slide in/out
  6. $('theSlide').addEvent('click', function(e){//add the click function (i.e on an anchor)
  7. e = new Event(e);//create a new event here
  8. mySlide.toggle();//do this to the selected element
  9. e.stop();//stop the event
  10. });
  11. }

Report this snippet  

You need to login to post a comment.