WEB OT javascript guru's -- question for you

Discussion in 'OT Technology' started by 95vr4, Feb 23, 2008.

  1. 95vr4

    95vr4 OT Supporter

    Joined:
    Oct 6, 2004
    Messages:
    2,513
    Likes Received:
    0
    Location:
    Weddington, NC
  2. 95vr4

    95vr4 OT Supporter

    Joined:
    Oct 6, 2004
    Messages:
    2,513
    Likes Received:
    0
    Location:
    Weddington, NC
    Here's the js
    Code:
    window.onload=function(){
    $$('#menu a').each(function(el) { 
    		el.addEvent('mouseenter',function(){
    		p = el.innerHTML.toUpperCase();
    		el.innerHTML = p;
    		el.setStyle('background','url(bg1.jpg)');
    		myEffect = el.effect('margin-left', {duration: 100,transition: Fx.Transitions.linear, wait: true}).start('10','30');
    		})
    		
    		el.addEvent('mouseleave',function(){
    		p = el.innerHTML.toLowerCase();
    		el.innerHTML = p;
    		el.setStyle('background','url(bg.jpg)');
    		myEffect = el.effect('margin-left', {duration: 800,transition: Fx.Transitions.Bounce.easeOut, wait: true}).start('30','0');
    		})
    	
    	})
    	
    	myStretch = document.getElementsByClassName('toggler');
    	myStretcher = document.getElementsByClassName('accordion');
    	
    	// setup the accordion elements by clearing display styles	
    	myStretcher.each(function(el){
    		el.style.display = '';
    	});
    	
    	
    var ac = new Fx.Accordion(myStretch,myStretcher,
     
      {
    		onActive: function(tog){
             tog.setStyle('color', '#ACDA4E');
    		tog.setStyle('background-color', '#1d1d1d');
    		tog.setStyle('cursor', 'help');
    		
        },
        onBackground: function(tog){
           
    		tog.setStyle('color', '#FFF');
    		tog.setStyle('background-color', '#2d2d2d');
    		tog.setStyle('cursor', 'help');
    		
        },
    		alwaysHide: true,
    		start : 'all-closed',
    	
    		height: true,
    		opacity : true			
    	});
    }
    
    st = document.getElementsByClassName('toggler2');
    	stc = document.getElementsByClassName('accordion2');
    	
    	// setup the accordion elements by clearing display styles	
    	stc.each(function(el){
    		el.style.display = '';
    	});
    	
    var acc = new Fx.Accordion(st,stc,
     
      {
    		onActive: function(tog){
             tog.setStyle('color', '#ACDA4E');
    		tog.setStyle('background-color', '#1d1d1d');
    		tog.setStyle('cursor', 'help');
    		
        },
        onBackground: function(tog){
           
    		tog.setStyle('color', '#FFF');
    		tog.setStyle('background-color', '#2d2d2d');
    		tog.setStyle('cursor', 'help');
    		
        },
    		alwaysHide: true,
    		start : 'all-closed',
    		opacity : true			
    	});
    	
    
     
  3. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA

Share This Page