Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: mootools

  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    280
    Thanks
    25
    Thanked 9 Times in 9 Posts

    mootools

    Hi, i was wondering if anyone knew how to make the vertical mootools area (which slides up and down) how to make it closed by default and then open on click?

    Code:
    window.addEvent('domready', function() {
    	var status = {
    		'true': 'open',
    		'false': 'close'
    	};
    	
    	//-vertical
    
    	var myVerticalSlide = new Fx.Slide('vertical_slide');
    
    	$('v_slidein').addEvent('click', function(e){
    		e.stop();
    		myVerticalSlide.slideIn();
    	});
    
    	$('v_slideout').addEvent('click', function(e){
    		e.stop();
    		myVerticalSlide.slideOut();
    	});
    
    	$('v_toggle').addEvent('click', function(e){
    		e.stop();
    		myVerticalSlide.toggle();
    	});
    
    	$('v_hide').addEvent('click', function(e){
    		e.stop();
    		myVerticalSlide.hide();
    		$('vertical_status').set('html', status[myVerticalSlide.open]);
    	});
    	
    	$('v_show').addEvent('click', function(e){
    		e.stop();
    		myVerticalSlide.show();
    		$('vertical_status').set('html', status[myVerticalSlide.open]);
    	});
    	
    	// When Vertical Slide ends its transition, we check for its status
    	// note that complete will not affect 'hide' and 'show' methods
    	myVerticalSlide.addEvent('complete', function() {
    		$('vertical_status').set('html', status[myVerticalSlide.open]);
    	});
    
    
    	//--horizontal
    	var myHorizontalSlide = new Fx.Slide('horizontal_slide', {mode: 'horizontal'});
    
    	$('h_slidein').addEvent('click', function(e){
    		e.stop();
    		myHorizontalSlide.slideIn();
    	});
    
    	$('h_slideout').addEvent('click', function(e){
    		e.stop();
    		myHorizontalSlide.slideOut();
    	});
    
    	$('h_toggle').addEvent('click', function(e){
    		e.stop();
    		myHorizontalSlide.toggle();
    	});
    
    	$('h_hide').addEvent('click', function(e){
    		e.stop();
    		myHorizontalSlide.hide();
    		$('horizontal_status').set('html', status[myHorizontalSlide.open]);
    	});
    	
    	$('h_show').addEvent('click', function(e){
    		e.stop();
    		myHorizontalSlide.show();
    		$('horizontal_status').set('html', status[myHorizontalSlide.open]);
    	});
    	
    	// When Horizontal Slide ends its transition, we check for its status
    	// note that complete will not affect 'hide' and 'show' methods
    	myHorizontalSlide.addEvent('complete', function() {
    		$('horizontal_status').set('html', status[myHorizontalSlide.open]);
    	});
    });

  • #2
    Regular Coder
    Join Date
    May 2005
    Posts
    190
    Thanks
    1
    Thanked 2 Times in 2 Posts
    var myVerticalSlide = new Fx.Slide('vertical_slide');

    To

    var myVerticalSlide = new Fx.Slide('vertical_slide').hide();


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •