jQuery method for adding highlights to web sites

  • 2020-06-22 23:49:21
  • OfStack

This article illustrates jQuery's approach to adding highlights to web sites. Share to everybody for everybody reference. The details are as follows:

This jquery code demonstrates how to mask the entire page and highlight something


$(function() {
  var docHeight = $(document).height();
  $("body").append("<div id='overlay'></div>");
  $("#overlay")
   .height(docHeight)
   .css({
     'opacity' : 0.4,
     'position': 'absolute',
     'top': 0,
     'left': 0,
     'background-color': 'black',
     'width': '100%',
     'z-index': 5000
   });
});

I hope this article has been helpful for your jQuery programming.


Related articles: