Skip to content

Instantly share code, notes, and snippets.

@hughfdjackson
Created June 7, 2012 13:47
Show Gist options
  • Select an option

  • Save hughfdjackson/2888870 to your computer and use it in GitHub Desktop.

Select an option

Save hughfdjackson/2888870 to your computer and use it in GitHub Desktop.
var toggleWidget = function(selector){
var state = {
on: false
, onFunc: function(){}
, offFunc: function(){}
, $el: $(selector)
}
o.$el.mouseenter(function(){
if ( state.on ) o.onFunc()
else o.offFunc()
})
return state
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment