Skip to content

Instantly share code, notes, and snippets.

@bryanjswift
Forked from anonymous/Mootools code
Created August 23, 2010 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryanjswift/546285 to your computer and use it in GitHub Desktop.
Save bryanjswift/546285 to your computer and use it in GitHub Desktop.
var Card = new Class({
Implements: [Options, Events],
options: {
index: 0,
bg: null
},
initialize: function(el, options){
this.setOptions(options);
el.addEvent('mouseenter', this.doRollOver).addEvent('mouseleave',doRollOut);
},
doRollOver: function(){
alert("over");
},
doRollOut: function(){
alert("out");
}
});
window.addEvent('domready', function(){
$$('.card').each(function(element, index){
element = new Card(element, {
index: index,
bg: element.getChildren('.cardBG')
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment