在图像控件中旋转图像 [英] Rotate images in image control
本文介绍了在图像控件中旋转图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新的asp .net.假设我有10张图片,并且我使用图片标签一次显示了一张图片.我想每10秒更改一次图片.因此,我使用的是更新面板和计时器,但无法正常工作.任何人都可以告诉我我该怎么做.
谢谢
dEV kASHYAP
I am new asp .net. Suppose I have 10 images and i using image tag to display a single image at one time. I want to change the picture after every 10 secounds. So i am using a update panel and timer but it is not working properly. Anybody can tell me how i can do this.
Thanks
dEV kASHYAP
推荐答案
<script src="../jquery-1.4.min.js" type="text/javascript"></script>
<div id="slider" style="width:200px;">
<p>jQuery Slide show</p>
<img id="img1" src="../images/aspnet4.gif" />
</div>
<script language="javascript" type="text/javascript">
var interval = 3000; // Line 1: time interval after which next image will load
var images = ['../images/aspnet4.gif', '../images/aspnet4css.gif', '../images/jquerycourse.gif']; // Line 2
var i = 1; // Line 3: default index of the image from the array that will be shown by default
setInterval(ChangeImages, interval); // Line 4: timer that will run after every interval
// function that will change the images
function ChangeImages() {
if (i == images.length) { i = 0; }
(#img1").slideUp('slow',function(){
("#img1").slideUp('slow', function () {
(this).attr('src', images [i]); i ++;}).slideDown('slow'); } < /script >
(this).attr('src', images[i]); i++; }).slideDown('slow'); } </script>
这篇关于在图像控件中旋转图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文