请问效果为什么出不来?

pmaster 2005-06-03 11:11:58
<SCRIPT LANGUAGE="JavaScript">
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = '../images/produce/p1.html'
Pic[1] = '../images/produce/p2.html'
Pic[2] = '../images/produce/p3.html'
// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
alert(document.images);
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
</script>

<script src="../images/produce/p1.html" type="SlideShow" width="399" height="148" border="0"></script>
...全文
166 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
pmaster 2005-06-09
  • 打赏
  • 举报
回复
你这个没有渐变消失的效果,请问能不能帮我改下有这个滤镜效果的吗?谢谢
flyskytoday 2005-06-09
  • 打赏
  • 举报
回复
刚才有个判断有误(t>2)--->(t>1)
现在改在如下
<SCRIPT LANGUAGE="JavaScript">
var slideShowSpeed = 5000;
var t=0;

var Pic = new Array();
Pic[0] = 'http://www.baidu.com'
Pic[1] = 'http://mp3.baidu.com'
Pic[2] = 'http://image.baidu.com'

function runSlideShow()
{
document.all.SlideShow.src=Pic[t];
if(t>1)t=0;else t++;
setTimeout('runSlideShow()', slideShowSpeed);
}
window.onload=runSlideShow;
</script>
<iframe src="" name="SlideShow" id="SlideShow" width="500" height="300" border="0"></iframe>
flyskytoday 2005-06-09
  • 打赏
  • 举报
回复
<SCRIPT LANGUAGE="JavaScript">

var slideShowSpeed = 5000;

var Pic = new Array();
Pic[0] = 'http://www.baidu.com'
Pic[1] = 'http://mp3.baidu.com'
Pic[2] = 'http://image.baidu.com'

var t=0;

function runSlideShow()
{
if (document.all)
{
document.all.SlideShow.src=Pic[t];
if(t>2)
t=0;
else
t++;
}

setTimeout('runSlideShow()', slideShowSpeed);
}
window.onload=runSlideShow;
</script>

<iframe src="" name="SlideShow" id="SlideShow" width="500" height="300" border="0"></iframe>
pmaster 2005-06-07
  • 打赏
  • 举报
回复
我想让这三个页面轮番显示,谢谢大家
flyskytoday 2005-06-03
  • 打赏
  • 举报
回复
不知道你要实现什么功能
也真看不出有什么效果
不过你下面这个是不对的
<script src="../images/produce/p1.html" type="SlideShow" width="399" height="148" border="0"></script>

这个只能连接js文件
如果想要连接页面,你可以用框架
<iframe src="../images/produce/p1.html" type="SlideShow" width="399" height="148" border="0"></iframe>
leo963258 2005-06-03
  • 打赏
  • 举报
回复
把下面的保存为js格式的。比如:p1.js
引用:
<script src="../images/produce/p1.js"></script>

P1js里面不要加<script></script>这个标记

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = '../images/produce/p1.html'
Pic[1] = '../images/produce/p2.html'
Pic[2] = '../images/produce/p3.html'
// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
alert(document.images);
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
hchxxzx 2005-06-03
  • 打赏
  • 举报
回复
说说你想干什么?
你问问题不能让人来猜谜语啊,最要紧是用最简单的话把你的意思完整表达出来,这样省了别人看代码猜老半天.

87,901

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧