Home > Web Front-end > JS Tutorial > 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
Release: 2016-05-16 17:53:34
Original
1166 people have browsed it
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.
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template