Home  >  Article  >  Web Front-end  >  jQuery method to add highlighting effect to website_jquery

jQuery method to add highlighting effect to website_jquery

WBOY
WBOYOriginal
2016-05-16 15:52:311307browse

The example in this article describes how jQuery can add highlighting effects to websites. Share it with everyone for your 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 will be helpful to everyone’s jQuery programming.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn