大神们好,想做个类似大的网站,图片滚动形式,代码如下<script type="text/javascript" src="focusflash.js">
<!--
var focus_width = 996; // 图片宽度
var focus_height= 400; // 图片高度
var text_height = 20; // 显示的文字高度
var swf_height = focus_height + text_height;
var pics ="image/21.jpg|image/21.jpg";
var links="image/21.jpg|image/21.jpg";
var texts="image/21.jpg|image/21.jpg";
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
document.write('width="'+ focus_width +'" ');
document.write('height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain">');
document.write('<param name="movie" value="focus.swf">');
document.write('<param name="quality" value="high">');
document.write('<param name="bgcolor" value="#ffffff">');
document.write('<param name="menu" value="false">');
document.write('<param name=wmode value="opaque">');
document.write('<param name="FlashVars" ');
document.write('value="pics='+pics);
document.write( '&links='+links);
document.write( '&texts='+texts);
document.write( '&borderwidth='+focus_width);
document.write( '&borderheight='+focus_height);
document.write( '&textheight='+text_height+'">');
document.write('<embed src="focus.swf" ');
document.write('wmode="opaque" ');
document.write('FlashVars="pics='+pics);
document.write( '&links='+links);
document.write( '&texts='+texts);
document.write( '&borderwidth='+focus_width);
document.write( '&borderheight='+focus_height);
document.write( '&textheight='+text_height+'" ');
document.write('menu="false" ');
document.write('bgcolor="#ffffff" ');
document.write('quality="high" ');
document.write('width="'+ focus_width +'" ');
document.write('height="'+ focus_height +'" ');
document.write('allowScriptAccess="sameDomain" ');
document.write('type="application/x-shockwave-flash" ');
document.write('pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
//-->
</script>
代码链接如下 http://www.cnblogs.com/zhuyiwen/archive/2006/06/07/420119.html我下载了个,但是不知道怎么用,求大神详解。。
<!--
var focus_width = 996; // 图片宽度
var focus_height= 400; // 图片高度
var text_height = 20; // 显示的文字高度
var swf_height = focus_height + text_height;
var pics ="image/21.jpg|image/21.jpg";
var links="image/21.jpg|image/21.jpg";
var texts="image/21.jpg|image/21.jpg";
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
document.write('width="'+ focus_width +'" ');
document.write('height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain">');
document.write('<param name="movie" value="focus.swf">');
document.write('<param name="quality" value="high">');
document.write('<param name="bgcolor" value="#ffffff">');
document.write('<param name="menu" value="false">');
document.write('<param name=wmode value="opaque">');
document.write('<param name="FlashVars" ');
document.write('value="pics='+pics);
document.write( '&links='+links);
document.write( '&texts='+texts);
document.write( '&borderwidth='+focus_width);
document.write( '&borderheight='+focus_height);
document.write( '&textheight='+text_height+'">');
document.write('<embed src="focus.swf" ');
document.write('wmode="opaque" ');
document.write('FlashVars="pics='+pics);
document.write( '&links='+links);
document.write( '&texts='+texts);
document.write( '&borderwidth='+focus_width);
document.write( '&borderheight='+focus_height);
document.write( '&textheight='+text_height+'" ');
document.write('menu="false" ');
document.write('bgcolor="#ffffff" ');
document.write('quality="high" ');
document.write('width="'+ focus_width +'" ');
document.write('height="'+ focus_height +'" ');
document.write('allowScriptAccess="sameDomain" ');
document.write('type="application/x-shockwave-flash" ');
document.write('pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
//-->
</script>
代码链接如下 http://www.cnblogs.com/zhuyiwen/archive/2006/06/07/420119.html我下载了个,但是不知道怎么用,求大神详解。。
解决方案 »
- mousemove的问题?
- 我用jsp改写的 梅花雪树型结构 可是运行不稳定 请各位帮我检查下
- js 点击图片 实现功能
- innerhtml 传参数
- [集团群]开发人员关于C#、VB和VBScrip的技术群(群内气氛较为活跃,喜静者勿加)
- 高难度问题,用js实现自动下载文件到本地,我忍痛给100分,在线等待
- 关于点击按钮 提交两个参数的问题
- 如何去掉附加的URL字符
- 有没有这种用法?<body onLoad="document.aa.bar_code.focus(),clock()"> clock()是javascript函数!
- JavaScript实现简单的图片库 功能 分离js与html时出现情况
- IE中怎么获得鼠标距离事件源左上角的坐标
- 本人初学js,有点基础问题请教一下
<head>
<style>
div{
cursor: pointer;
font-size:10pt;
}
.pb{
width:300px;/*单个图片的宽(和显示区域相同)*/
height:300px;/*单个图片的高(和显示区域相同)*/
}
#plist{
position:relative;
top:-29px;
}
#pshow{
width:300px;/*显示区域的宽度*/
height:300px;/*显示区域的高度*/
overflow: hidden;
position:absolute;
top:20px;
left:20px;
}
</style>
<script src="jquery-1.9.1.js" type="text/javascript"></script>
<script>
var i=1;
function pchange(obj){
var imgtop=((0-(obj-1))*300-29)+"px";
$("#plist").animate({
top:imgtop
},"slow");
i=obj++;
if(i>4){
i=1;
}
}
function timechange(){
pchange(i);
i++;
if(i>4){
i=1;
}
setTimeout('timechange()',3000);
}
</script>
</head>
<body onload="timechange()">
<div id="pshow">
<div style="display:table;position:relative;left:150px;top:260px;z-index:99;">
<div style="display:table-cell;width:25px;height:20px;background:#EEEE00;text-align:center;" onmouseover="pchange(1)">1</div>
<div style="display:table-cell;width:10px;height:20px;"></div>
<div style="display:table-cell;width:25px;height:20px;background:#EEEE00;text-align:center;" onmouseover="pchange(2)">2</div>
<div style="display:table-cell;width:10px;height:20px;"></div>
<div style="display:table-cell;width:25px;height:20px;background:#EEEE00;text-align:center;" onmouseover="pchange(3)">3</div>
<div style="display:table-cell;width:10px;height:20px;"></div>
<div style="display:table-cell;width:25px;height:20px;background:#EEEE00;text-align:center;" onmouseover="pchange(4)">4</div>
</div>
<div id="plist">
<div class="pb" style="background:green;">
</div>
<div class="pb" style="background:red;">
</div>
<div class="pb" style="background:blue;">
</div>
<div class="pb" style="background:yellow;">
</div>
</div>
</div>
</body>
</html>
var links="image/21.jpg|image/21.jpg";
var texts="image/21.jpg|image/21.jpg";pics是图片的列表,用|分割,
links是图片连接的列表,用|分割,
texts是说明文字的类表,用|分割。再修改
var focus_width = 996; // 图片宽度
var focus_height= 400; // 图片高度
var text_height = 20; // 显示的文字高度
var swf_height = focus_height + text_height;
调整到你想要的合适的尺寸。