如何使用Jscript在图像上淡化新图像并淡出旧图像 [英] How to Fadein new image and fadeout old image on a image using Jscript

查看:71
本文介绍了如何使用Jscript在图像上淡化新图像并淡出旧图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在图像中,我想以新图像淡入和旧图像淡出的方式逐一更改图像.如果您知道的话,请帮助我.谢谢.

Hi,
In a image i want to change the images one by one as, new image fadein and old image fadeout. Please help me if you know. Thank you.

推荐答案

尝试jQuery

您可以在页面中查询对象,例如
Try jQuery,

You can query for objects in your page, for example


("img.first")将所有图像匹配为"first"类.

因此,如果页面上有两个图像:
("img.first") matches all images with a class ''first''.

So if you have two images on your page :
<img src="/images/first.jpg" class="first" alt="First" />
<img src="/images/second.jpg" class="second" alt="Second" style="display: none;" />



然后使用以下javascript淡出第一个图像,并淡入第二个图像.请注意,我编写了此代码,以便在页面加载后立即执行:



Then use the following javascript to fade out the first, and fade in the second image. Notice I wrote this code to be executed as soon as the page is loaded :


(文档).ready(function()){
(document).ready(function ()) {


这篇关于如何使用Jscript在图像上淡化新图像并淡出旧图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆