就是网站上面有个头条图片新闻,图片在某个文件夹下面,在首页的某个位置播放最新三条图片新闻,用幻灯片的方式显示图片。我想模仿的效果在此: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上面让它轮流显示呢?怎么搞?新手急求,万分感谢!
解决方案 »
- JAVA / JS 实现截取一个网页保存成一张图片(jpg/pdf)的功能,网页还有滚动条哦。求大神赐教,谢谢,全部积分给你们
- extjs4 如何为treepanel动态添加节点
- Jquery easyui combotree跟.net集成开发
- 简单而精深的function 问题?大大帮忙吖
- 背景图片改变的问题 急求
- 如何按字数截取包含BR的字符串
- 请问怎么用JavaScript删除文件?
- 怎么修改DIV的滚动条的位置
- 用jscript如何动态显示隐藏一个select元素?
- 使用JS动态添加元素和移除元素
- 怎么在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 只是一个框,或者说是个容器,关键是怎么让轮流播放的图片在这上面显示?