本文介绍了在gridview中的缩略图内显示多个滑动图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用javascript创建一个图像网格(3X3)。多个图像应位于每个缩略图内,图像应连续滑动。
我的代码如下:
< html> < HEAD> < /头> <身体GT;
< img height =200name =slidewidth =200/> | < img height =200name =slide1width =200/> |
< img height =200name =slide2width =200/> | < img height =200name =slide3width =200/> |
< script language =JavaScript> var i = 0; var path = new Array(); // LIST OF IMAGES path [0] =http://www.electricprism.com/aeron/slideshow/examples/1.jpg; path [1] =http://www.phpf1.com/images/maxSlideShow/slideshow.jpg; path [2] =http://www.welie.com/patterns/images/slideshow-pro.png; var j = 0; var image = new Array(); image [0] =http://www.electricprism.com/aeron/slideshow/examples/1.jpg; image [1] =http://www.phpf1.com/images/maxSlideShow/slideshow.jpg; image [2] =http://www.welie.com/patterns/images/slideshow-pro.png; function swapImage(){document.slide.src = path [i]; if(i< path.length - 1)i ++;否则i = 0;的setTimeout( swapImage(),3000); document.slide1.src = path [i]; if(i< path.length - 1)i ++;否则i = 0;的setTimeout( swapImage(),3000); document.slide2.src = image [j]; if(j< path.length - 1)j ++;否则j = 0;的setTimeout( swapImage(),3000); document.slide3.src = image [j]; if(j< path.length - 1)j ++;否则j = 0;的setTimeout( swapImage(),3000); } window。> < /体> < / HTML>
但是,我希望我的代码更具动态性。创建这种网格的最佳方法是什么?如果是这样,指向教程的链接会很有帮助!在此先感谢
I need to create a grid of images(3X3) using javascript. Multiple Images should reside inside each thumbnail and the images should slide continuously.
My code is as below:
<html> <head> </head> <body>
<img height="200" name="slide" width="200" /> | <img height="200" name="slide1" width="200" /> |
<img height="200" name="slide2" width="200" /> | <img height="200" name="slide3" width="200" /> |
<script language="JavaScript"> var i = 0; var path = new Array(); // LIST OF IMAGES path[0] = "http://www.electricprism.com/aeron/slideshow/examples/1.jpg"; path[1] = "http://www.phpf1.com/images/maxSlideShow/slideshow.jpg"; path[2] = "http://www.welie.com/patterns/images/slideshow-pro.png"; var j=0; var image= new Array(); image[0] = "http://www.electricprism.com/aeron/slideshow/examples/1.jpg"; image[1] = "http://www.phpf1.com/images/maxSlideShow/slideshow.jpg"; image[2] = "http://www.welie.com/patterns/images/slideshow-pro.png"; function swapImage() { document.slide.src = path[i]; if(i < path.length - 1) i++; else i = 0; setTimeout("swapImage()",3000); document.slide1.src = path[i]; if(i < path.length - 1) i++; else i = 0; setTimeout("swapImage()",3000); document.slide2.src = image[j]; if(j < path.length - 1) j++; else j = 0; setTimeout("swapImage()",3000); document.slide3.src = image[j]; if(j < path.length - 1) j++; else j = 0; setTimeout("swapImage()",3000); } window.> </body> </html>
But,I want my code to be more dynamic. What would be the best way to create this kind of a grid? If so, a link to a tutorial would be helpful! Thanks in advance
推荐答案
我认为你需要这个 - 带有jQuery Slider的ASP.NET中继器 [ ^ ]。
I think you need this - ASP.NET Repeater with jQuery Slider[^].
这篇关于在gridview中的缩略图内显示多个滑动图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!