就是网站上面有个头条图片新闻,图片在某个文件夹下面,在首页的某个位置播放最新三条图片新闻,用幻灯片的方式显示图片。我想模仿的效果在此:http://www.crown2828.com/我看它用的是swfobject.js,我从官方已经下载到swfobject.js文件,版本是v1.5的。首页里也插入了相关代码:
<HEAD>
<script type="text/javascript" src="swfobject.js"></script>
</HEAD>
<BODY>
<div style="position:relative;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="734" height="322">
<param name="movie" value="banner.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="banner.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="734" height="322"></embed>
</object>
</div>
现在banner.swf文件也有了,就是怎样将某文件夹下的图片添加到网页的banner.swf上面让它轮流显示呢?怎么搞?新手急求,万分感谢!
<HEAD>
<script type="text/javascript" src="swfobject.js"></script>
</HEAD>
<BODY>
<div style="position:relative;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="734" height="322">
<param name="movie" value="banner.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="banner.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="734" height="322"></embed>
</object>
</div>
现在banner.swf文件也有了,就是怎样将某文件夹下的图片添加到网页的banner.swf上面让它轮流显示呢?怎么搞?新手急求,万分感谢!
解决方案 »
- jquery.validate.js 的错误
- 163邮箱添加附件功能可以用鼠标拖动硬盘文件到指定位置即上传附件怎么实现啊?
- div不能触发事件?
- 以变量做为文本框的Name要如何通过JS判空
- js获取月末最后一天
- 高手指教,document.forms[0]这里指的是什么?初学菜鸟
- json出现不明字符的问题
- js replace问题,在线等
- 求《深入学习:JavaScript 开发与实例》的电子书,谢谢各位~
- 打开一个新窗口时,如何使新打开窗口右上角的关闭按纽不可用,即是灰色的
- 怎么在JS中删除控件的事件?
- 【♠】jQuery $('.pic img').load()不起作用 第一次执行了,刷新后又不执行了
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<style>
body{ background-color: #000}#oContent {
width: 476px;height: 330px;background-color: #000;border: 2px solid #dddddd;position: relative;z-index: 3;left:100px;
}
#MainPic {
visibility: visible;position: absolute;width: 400px;height: 300px;left: 1px;top: 1px;filter: RevealTrans(duration=1)
}#showInfo {
margin-top: 305px;float: left;width: 400px;text-align: center;font-size: 9pt;color: #FFFFFF;
}
.thubpic {
PADDING-RIGHT: 0px; PADDING-LEFT: 4px; Z-INDEX: 20; PADDING-BOTTOM: 0px; WIDTH: 63px; CURSOR: pointer; PADDING-TOP: 4px; TOP: 10px; HEIGHT: 49px
}
.thubpiccur {
PADDING-RIGHT: 0px; PADDING-LEFT: 4px; Z-INDEX: 20; PADDING-BOTTOM: 0px; WIDTH: 63px; CURSOR: pointer; PADDING-TOP: 4px; TOP: 10px; HEIGHT: 49px
}
.thubpiccur {
Z-INDEX: 30; BACKGROUND: url(./images/arrow3.gif) no-repeat left 50%
}
.thubpic IMG {
BORDER-RIGHT: #666 3px solid; BORDER-TOP: #666 2px solid; BORDER-LEFT: #666 3px solid; WIDTH: 56px; BORDER-BOTTOM: #666 2px solid; HEIGHT: 42px
}
.thubpiccur IMG {
BORDER-RIGHT: #666 3px solid; BORDER-TOP: #666 2px solid; BORDER-LEFT: #666 3px solid; WIDTH: 56px; BORDER-BOTTOM: #666 2px solid; HEIGHT: 42px
}
.thubpiccur IMG {
BORDER-LEFT-COLOR: #fff; BORDER-BOTTOM-COLOR: #fff; BORDER-TOP-COLOR: #fff; BORDER-RIGHT-COLOR: #fff
}
</style>
<script language="JavaScript">
<!-- var isIE = (document.all) ? true : false; var $ = function(id){
return "string" == typeof id ? document.getElementById(id) : id;
} var Each = function(list, fun){
for(var i = 0; i < list.length; i++){ fun(list[i],i)}
} Object.extend = function(distination, source){
for(var property in source){
distination[property] = source[property];
} return distination;
} var Class = {
create : function(){
return function(){
this.initialize.apply(this, arguments);
}
}
} var picChange = Class.create(); picChange.prototype = {
initialize : function(arrInfo, options){
this._timer = null;this._index = 0;this._img = $('oDiv').getElementsByTagName("img");
this.setOption(options);
this._info = arrInfo;
this._time = this.options.Time;
this.Set();
}, setOption : function(options){
this.options = {
auto : true,
Time : 3000
}
Object.extend(this.options, options || {});
}, Set : function(){
var oThis = this;
Each(this._img, function(o, i){
o.onmouseover = function(){
oThis.Run(i);
}
})
this.Run(this._index); }, Show : function(){
if(isIE){
$('MainPic').filters.revealTrans.Transition = Math.floor(Math.random() * 23);
$('MainPic').filters.revealTrans.apply();
$('MainPic').filters.revealTrans.play(); }
}, Run : function(j){
this.Stop();
var oThis = this;
j++;
if(j > this._img.length) j = 1;
this.Show();
$('MainPic').src = this._img[j-1].src;
$('showInfo').innerHTML = this._info[j-1];
for(var k = 0;k < this._img.length; k++) $("tmb"+k).className = "thubpic";
$("tmb"+(j-1)).className = "thubpiccur";
this._timer = setTimeout(function(){oThis.Run(j)},this._time);
}, Stop : function(){
clearTimeout(this._timer);
}
}
//-->
</script>
</head><body>
<div id="oContent">
<A id=foclnk target=_blank>
<img id="MainPic" alt="" src="images/01.jpg" />
</A>
<DIV id="showInfo"></DIV>
<DIV style="MARGIN-LEFT: 402px; WIDTH: 65px" id="oDiv">
<DIV class=thubpiccur id="tmb0" ><A href="#"><IMG src="images/01.jpg" alt="" width=56 height=42 border="0"></A></DIV>
<DIV class=thubpic id="tmb1" ><A href="#"><IMG height=45 alt="" src="images/02.jpg" width=56></A></DIV>
<DIV class=thubpic id="tmb2" ><A href="#"><IMG height=45 alt="" src="images/03.jpg" width=56></A></DIV>
<DIV class=thubpic id="tmb3" ><A href="#"><IMG height=45 alt="" src="images/04.jpg" width=56></A></DIV>
<DIV class=thubpic id="tmb4" ><A href="#"><IMG height=45 alt="" src="images/05.jpg" width=56></A></DIV>
<DIV class=thubpic id="tmb5" ><A href="#"><IMG height=45 alt="" src="images/06.jpg" width=56></A></DIV>
</DIV>
</div><script>
new picChange(['梦:牧场小屋', '碎玉:回眸', '碎玉:回眸', '牛说不哭:烈日下的建筑工人', '新疆瓦格:哈萨克族搭建毡房','松间明月:汽车文化'],{Auto:false,timer:2000});
</script>
</body>
</html>图片你自己换几张
也就是说 swfobject 是帮你放入 swf 的而不是帮你生成 swf 的!!http://www.crown2828.com/banner.swf
我知道banner.swf 只是一个框,或者说是个容器,关键是怎么让轮流播放的图片在这上面显示?