Dear Appery,
I'm trying to add a highlight effect such as this highlight, i added this plugin to my project, it works well but it messed up some css with select and other widgets so i was looking for other solution to achieve the same effect without any plugin, i found this simple function that does this without any plugin:
code
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(); });
});
}
/code
however i cant get it to work as a function from a JS asset to be accessible from any page in my project, any help would be highly appreciated!!
Many thanks in advance!.
Best,
R.