Skip to content

Instantly share code, notes, and snippets.

@alanfluff
Last active January 9, 2018 09:46
Show Gist options
  • Save alanfluff/4353262 to your computer and use it in GitHub Desktop.
Save alanfluff/4353262 to your computer and use it in GitHub Desktop.
Yellow fade effect with JQuery - Stack Overflow
jQuery.fn.highlight = function () {
$(this).each(function () {
var el = $(this);
$("<div/>")
.width(el.outerWidth())
.height(el.outerHeight())
.css({
"position": "absolute",
"left": el.offset().left,
"top": el.offset().top,
"background-color": "#ffff99",
"opacity": ".7",
"z-index": "9999999"
}).appendTo('body').fadeOut(1000).queue(function () { $(this).remove(); });
});
}
@alanfluff
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment