x-browser:hover


/ Published in: jQuery
Save to your folder(s)

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}


Copy this code and paste it in your HTML
  1. $.fn.hovr = function(clss){
  2. $(this).live("mouseover",function(){
  3. $(this).addClass(clss);
  4. });
  5. $(this).live("mouseout",function(){
  6. $(this).removeClass(clss);
  7. });
  8. return this;
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.