旋转图片 [英] Rotating pictures
问题描述
我正在寻找可以在不刷新
页面的情况下旋转图片的代码。我想从
数据库中随机选择5张图片,然后每隔5秒继续旋转它们。
感谢任何帮助。
Hi,
I am looking for code which can rotate pictures without refreshing the
page. I want to read randomly selected 5 images from
database and then keep on rotating them every 5 seconds.
Any help is appreciated.
推荐答案
Sehboo写于13 okt 2005 microsoft.public.inetserver.asp.general:
Sehboo wrote on 13 okt 2005 in microsoft.public.inetserver.asp.general:
我正在寻找可以旋转图片的代码没有刷新
页面。我想从
数据库中随机选择5个图像,然后每隔5秒继续旋转它们。
I am looking for code which can rotate pictures without refreshing the
page. I want to read randomly selected 5 images from
database and then keep on rotating them every 5 seconds.
你想要这个服务器端吗?
只有随机选择可以在服务器端完成。
对于旋转我建议你去客户端NG。
然后,你有没有想到的代码,
或者你想让别人做所有的工作?
-
Evertjan。
荷兰。
(替换所有十字架我的电子邮件中的点)
And you want to do this serverside?
Only the random selection can be done serverside.
For the "rotation" I would suggest you go to a clientside NG.
And then, did you have some code in mind,
or do you want someone to do all the work?
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
我有javascript代码可以播放幻灯片,但是我想要从数据库中读取图像URL,而不是硬编码。这是
到目前为止我所拥有的。
var timerID = 0;
var imgArray = new Array (images \ _116.gif," images \ _117.gif",
" images \ _118.gif"," images \ _119.gif");
//我想从数据库中读取上面的数组。
function setupAdbanner(){
rotateBanner();
timerID = setInterval(" rotateBanner()",5000);
}
函数cleanupPage(){
if(timerID)
clearInterval(timerID);
}
函数rotateBanner(){
imgIndex = Math.ceil(Math.random()* imgArray.length) - 1;
document.images [" HatContestPhotos"]。src = imgArray [imgIndex] ;
}
Hi,
I have the javascript code which does the slideshow, but I want to read
the image URLs from database, and not hard code them here. Here is
what I have so far.
var timerID=0;
var imgArray = new Array("images\116.gif", "images\117.gif",
"images\118.gif", "images\119.gif");
// I want to read the above array from database.
function setupAdbanner() {
rotateBanner();
timerID = setInterval("rotateBanner()", 5000);
}
function cleanupPage() {
if (timerID)
clearInterval(timerID);
}
function rotateBanner() {
imgIndex = Math.ceil(Math.random() * imgArray.length) - 1;
document.images["HatContestPhotos"].src= imgArray[imgIndex];
}
Sehboo在microsoft.public.inetserver.asp.general上写了13 okt 2005:
Sehboo wrote on 13 okt 2005 in microsoft.public.inetserver.asp.general:
var imgArray = new Array(" images\116.gif", " images \ _117.gif",
" images \ _118.gif"," images \ _119.gif");
//我想从数据库中读取上面的数组。
var imgArray = new Array("images\116.gif", "images\117.gif",
"images\118.gif", "images\119.gif");
// I want to read the above array from database.
现在我们到了某个地方。
[请总是引用你回复的文字,
这是usenet,而不是电子邮件]
下一个问题是,你有什么数据库?
..mdb-file,.txt-file等< br $>
-
Evertjan。
荷兰。
(用我的电子邮件地址替换所有带点的十字架)
Now we are getting somewhere.
[please always quote the text you are responding on,
this is usenet, not email]
Next question is, what database you have?
..mdb-file, .txt-file, etc.
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
这篇关于旋转图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!