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 1 of 1
  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    106
    Thanks
    27
    Thanked 3 Times in 3 Posts

    simple mootools accordion with hover effect

    Hi all,
    I'm trying to customize the mootools accordion demo (http://demos.mootools.net/Accordion). I'm trying to add a mouseover effect on the togglers. I'd like them to change their background color on mouse over. Could you help me a little?

    This is the javascript code:
    Code:
     window.addEvent('domready', function() {
    	
    	//create our Accordion instance
    	var myAccordion = new Accordion($('accordion'), 'div.toggler', 'div.element', {
    		opacity: false,
    		onActive: function(toggler, element){
    			toggler.setStyle('color', '#41464D');
    		},
    		onBackground: function(toggler, element){
    			toggler.setStyle('color', '#528CE0');
    		}
    	});
    });
    I tried to add something like:
    Code:
    $('div.toggler').addEvent('mouseover', function(){
     			toggler.setStyle('background-color', '#000000');
     	});
    but didn't work
    Last edited by ktsixit; 05-29-2009 at 01:12 PM.


 

Posting Permissions

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