Home  >  Article  >  Web Front-end  >  jQuery-onload allows the image to fade in when the page is loaded for the first time_jquery

jQuery-onload allows the image to fade in when the page is loaded for the first time_jquery

WBOY
WBOYOriginal
2016-05-16 17:53:341151browse
Copy code The code is as follows:

$("#load img").load(function() {
//The picture is hidden by default
$(this).hide();
//Use fadeIn special effect
$(this).fadeIn("5000");
})


When opening a page for the first time, hide the loaded image first, and then execute the animation fadeIn.

The load event here: When all child elements have been completely loaded, the load event is sent to this element.
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