Last active
March 3, 2021 08:48
-
-
Save cyberdev/f3c7d8b2376d9b54181d6ee465e549f6 to your computer and use it in GitHub Desktop.
highlight element with jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.highlight = function() { | |
$(this).each(function() { | |
var el = $(this); | |
el.before("<div/>") | |
el.prev() | |
.width(el.width()) | |
.height(el.height()) | |
.css({ | |
"position": "absolute", | |
"background-color": "#ffff99", | |
"opacity": ".9" | |
}) | |
.fadeOut(1000, function(){ | |
$(this).remove(); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment