Return to Snippet

Revision: 4150
at October 30, 2007 05:52 by 1man


Updated Code
function toggleSlide(){
	//Select the element you wish to slide
	var mySlide = new Fx.Slide('slide');
 
	//Create a slide in/out
	$('theSlide').addEvent('click', function(e){//add the click function (i.e on an anchor)
		e = new Event(e);//create a new event here
		mySlide.toggle();//do this to the selected element
		e.stop();//stop the event
	});
}

Revision: 4149
at October 29, 2007 07:30 by 1man


Initial Code
function toggleSlide(){
	//Select the element you wish to slide
	var mySlide = new Fx.Slide('slide');
 
	//Create a slide in/out
	$('theSlide').addEvent('click', function(e){//add the click function
		e = new Event(e);//create a new event here
		mySlide.toggle();//do this to the selected element
		e.stop();//stop the event
	});
}

Initial URL

                                

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

Initial Title
Mootools Slide Toggle

Initial Tags
javascript

Initial Language
JavaScript