Logo du Blog de Kromack (Samuel Sanchez)

Ressources et tutoriaux : Web 2.0 – PHP – CodeIgniter – Webdesign

MooEasyRollover – The easiest rollover image plugin for Mootools !

MooEasyRollover – The easiest rollover image plugin for Mootools !

10 juin 2009

MooEasyRollover logo

What is MooEasyRollover ?

MooEasyRollover is a plugin for Mootools that allows you to make a simple rollover image without writing any code line !
The plugin is able to detect all images tagged with a specific class in order to add a rollover image behavior with an image caching.

Live Demo

Check out the MooEasyRollover live demo to see it in action !

Why this Mootools plugin ?

I was working on an old website that use the Macromedia function mm_swapimage, when I added some Mootools stuff, I thought it can be cool to be able to do the same work than mm_swapimage with a Mootools class ;)

Installation instructions

  • Download the MooEasyRollover archive.
  • Then, add mootools to your page, note that the plugin requires the Assets class of the more builder.
  • Add the MooEasyRollover class to your page :
<script src="/js/mooeasyrollover/mootools-1.2.2-core.js" type="text/javascript"></script>
<script src="/js/mooeasyrollover/mootools-1.2.2.2-more.js" type="text/javascript"></script>
<script src="/js/mooeasyrollover/mooeasyrollover.js" type="text/javascript"></script>
  • Use this code to launch the plugin. Make sure to set options with the correct values according to your server.
?View Code JAVASCRIPT
window.addEvent('domready', function() {
 
        //MooEasyRollover launcher
	var MooEasyRolloverInstance = new MooEasyRollover({
		MooEasyRolloverClass : 'rollover', //Set the class which tags all buttons to rollover
		fullPath : 'http://www.domain.com/buttons/', //Set the full path to your images folder
		prefix: '-on' //Set the prefix of mouseover images
	});	
 
});

MooEasyRolloverClass is the classname used to identify images to rollover.

Fullpath is the path to the images folder to use.

Prefix is used to identify rollover images, for exemple, in order to rollover button.png you have to create a button-on.png image in the fullPath folder.

Download

Click here to download MooEasyRollover.

5 comments

  1. MooEasyRollover plugin for #Mootools released ! Please Check-out http://bit.ly/rk4qy
    Spread the world people, RT needed :)

  2. Check-out MooEasyRollover : http://bit.ly/rk4qy

  3. Script sympathique, mais je crois avoir entendu dire que mouseover et mouseout étaient moins « standard » que mouseenter et mouseleave
    mais bon sinon ca marche pas trop mal.

    bon boulot !

  4. Merci pour l’info, je checkerai dès mon retour de vacances ;)

  5. RT @carterthespy: MooEasyRollover by @Kromack. Now in deployment on Vovo. So frakking easy, baby! http://bit.ly/15smB6 // :)

Leave a Reply

Optimized by SEO Ultimate