Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How jquery makes the picture disappear gradually

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of "how jquery makes pictures disappear gradually". Xiaobian shows you the operation process through actual cases. The operation method is simple, fast and practical. I hope this article "how jquery makes pictures disappear gradually" can help you solve the problem.

Gradually disappear method: 1, with fadeOut(), just set the number of milliseconds to disappear from visible, syntax "$("img").fadeOut(milliseconds)";2, with fadeTo() set the transparency to 0 in the specified number of milliseconds, syntax "$("img").fadeTo(milliseconds, 0)".

This tutorial operates on Windows 7, jquery version 1.10.2, Dell G3 PC.

jquery makes pictures fade away

Method 1: Use fadeOut()---to make the image disappear gradually

The fadeOut() method hides the selected element using a fade effect

$(document).ready(function() { $("button").click(function() { $("img").fadeOut(3000); }); });

Let the pictures fade away.

Method 2: Use fadeTo()---placeholder to make the picture fade away

The fadeTo() method gradually changes the opacity of the selected element to the specified value.

Just reduce the final transparency to 0.

$(document).ready(function() { $("button").click(function() { $("img").fadeTo(3000,0); }); });

Let the pictures fade away.

That's all for "how jquery makes pictures fade away." Thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the industry information channel. Xiaobian will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report