/ Published in: jQuery
Pass in whatever class will apply the hover style;\r\n\r\n$(\"div.hover\").hovr(\"hoverHover\") \r\n\r\nwould act like a cross browser version of \r\ndiv.hover{color:blue} div.hover:hover{text-decoration:underline}\r\n\r\nwhich would be in css for the jquery plugin hovr:\r\n\r\ndiv.hover{color:blue}\r\n\r\ndiv.hoverHover{text-decoration:underline}
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$.fn.hovr = function(clss){ $(this).live("mouseover",function(){ $(this).addClass(clss); }); $(this).live("mouseout",function(){ $(this).removeClass(clss); }); return this; }