HTML
<div id="toHover">Example, hover this area</div>
CSS
table { border-collapse: collapse; empty-cells: show; }
td, th { border: 1px solid #FFFFFF; padding: 4px; font-size: 1em; }
p { font-size: 1.2em; line-height: 1.5em;}
div {padding: 4px; border: 1px solid #f00; background-color: #fdd; }
.aHover { background-color: transparent; cursor:pointer; }
Javascript
$(document).ready(function(){
$("div").hoverClass("aHover");
$("address.email").each(function(){
$(this).html("<a href=\"mailto:" + this.title.replace(/( \[at\] )/g, "@").replace(/( \[(dot|period)\] )/g, ".").replace(/( \[dash\] )/g, "-") + "?subject=Question%20Regarding%20" + escape($("title").html()) + "\" title=\"Send " + $(this).html() + " an email regarding " + $("title").html() + "\">" + $(this).html() + "<\/a>");
this.setAttribute("title", "");
});
});
$.fn.hoverClass = function(c) {
return this.each(function(){
$(this).hover(
function() { $(this).addClass(c); },
function() { $(this).removeClass(c); }
);
});
};











0 comments:
Post a Comment