在几秒钟内更改网页中的图像 [英] Change images in few seconds in web page

查看:66
本文介绍了在几秒钟内更改网页中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有义务每隔几秒钟进行一次图像旋转/更改.我想通过javascript完成此操作.

我知道我可以通过使用更新面板来做到这一点,但对我而言,必须使用javascript.一些后备功能是:

我碰到了一些javascript代码,这些代码会在几秒钟内旋转图像,但是它们使用图像路径.我将图像保存在数据库中,所以没有指向的实际文件.那么有人可以向我解释我该怎么做?也许,如果有的话,一些例子会有很大帮助.非常感谢.

Hello all,

I have an obligation to do a image rotation/change in every few seconds. I want to accomplish this by javascript.

I know i can do it by using a update panel but using javascript is a must for me. Some fallbacks are:

I have bumped into some javascript codes that rotates the images in a few seconds but they use an image path. I saved my images in a database so I dont have an actual file to point at. So can someone explain to me how i can do this? maybe if possible, some examples help a lot. Thank you very much.

推荐答案

创建一个简单的处理程序,即.ashx文件.一旦使用参数访问此处理程序,它将从数据库返回实际图像.例如,URL abc.ashx?img = 1应该返回第一个图像文件abc.ashx?img = 2应该返回第二个图像文件.并使用此url作为您的javascript文件中的图片名称/路径.

问候
帕旺
create a simple handler, i.e., .ashx file. That returns the actual images from database once you access this handler with a parameter.For example the url abc.ashx?img=1 should return the first image file abc.ashx?img=2 should return the second one. And use this url as image names/path in your javascript file.

Regard
Pawan


这篇关于在几秒钟内更改网页中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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