首页 ┆ 网站地图 ┆ 在线留言 ┆ 游戏资讯 ┆ 资源下载 
设为首页
加入收藏
联系我们
热门关键字: .net应用  操作系统  Dreamweaver  WinRAR  网络推广
高级搜索
您当前的位置: 主页>编程相关>JAVASCRIPT>幻灯片焦点图片新闻显示调用focus.swf 的参考
幻灯片焦点图片新闻显示调用focus.swf 的参考
来源: 发布时间:2008-02-19 发布人: 浏览: 人次   字体: [ ]  

关于 focus.swf 调用(网上资源)
焦点图片新闻,是通过一个 Flash 文件来调用图片,使图片交互切换。其中变量:
pics: 指明交替的图片路径,以“|”进行分隔;
links: 指明点击每幅图片打开的链接,以“|”进行分隔,与 pics 的图片一一对应;
texts: 指明每幅图片的文字说明,以“|”进行分隔,与 pics 的图片一一对应;
focus_width: 指明 Flash 中图片的宽度;
focus_height: 指明 Flash 中图片的高度;
text_height: 指明 Flash 中说明文字所占的高度;
swf_height: 为  Flash 的高度。

经测试,图片只支持JPG格式的文件。

分析整理出如下代码:

源代码
 1<script type="text/javascript">
 2    <!--
 3   
 4    var focus_width = 375;    // 图片宽度
 5    var focus_height= 500;    // 图片高度
 6    var text_height = 20;    // 显示的文字高度
 7    var swf_height = focus_height + text_height;
 8   
 9    var pics ="3643603.jpg|3644310.jpg|3647102.jpg|3649097.jpg|3646832.jpg|3649095.jpg|3649096.jpg";
10    var links="3643603.jpg|3644310.jpg|3647102.jpg|3649097.jpg|3646832.jpg|3649095.jpg|3649096.jpg";
11    var texts="3643603.jpg|3644310.jpg|3647102.jpg|3649097.jpg|3646832.jpg|3649095.jpg|3649096.jpg";
12   
13    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
14    document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
15    document.write('width="'+ focus_width +'" ');
16    document.write('height="'+ swf_height +'">');
17    document.write('<param name="allowScriptAccess" value="sameDomain">');
18    document.write('<param name="movie" value="focus.swf">');
19    document.write('<param name="quality" value="high">');
20    document.write('<param name="bgcolor" value="#ffffff">');
21    document.write('<param name="menu" value="false">');
22    document.write('<param name=wmode value="opaque">');
23    document.write('<param name="FlashVars" ');
24    document.write('value="pics='+pics);
25    document.write(        '&links='+links);
26    document.write(        '&texts='+texts);
27    document.write(        '&borderwidth='+focus_width);
28    document.write(        '&borderheight='+focus_height);
29    document.write(        '&textheight='+text_height+'">');
30    document.write('<embed src="focus.swf" ');
31    document.write('wmode="opaque" ');
32    document.write('FlashVars="pics='+pics);
33    document.write(        '&links='+links);
34    document.write(        '&texts='+texts);
35    document.write(        '&borderwidth='+focus_width);
36    document.write(        '&borderheight='+focus_height);
37    document.write(        '&textheight='+text_height+'" ');
38    document.write('menu="false" ');
39    document.write('bgcolor="#ffffff" ');
40    document.write('quality="high" ');
41    document.write('width="'+ focus_width +'" ');
42    document.write('height="'+ focus_height +'" ');
43    document.write('allowScriptAccess="sameDomain" ');
44    document.write('type="application/x-shockwave-flash" ');
45    document.write('pluginspage="http://www.macromedia.com/go/getflashplayer" />');
46    document.write('</object>');
47   
48    //-->
49</script>
50


相 关 文 章   发布商链接
·Adobe Reader利用javascript让PDF文...
·基于Ajax的可滚动表格代码实例
·浅谈javascript函数劫持,附实例
·使用javascript标记高亮关键词的代码...
·javascript读写TEXT文本文件示例代码
·javascript实现动态多附件上传方法
·javascript利用xhtml来实现动态导入j...
·JS遍历所有以TextBox_开头匹配的文本...
·Javascript实现打印网页中定义的部分...
·javascript实现在IE中图片的拖拽
 §最新评论:(评论内容只代表网友观点,与本站立场无关!)
网名: 验证码:  【所有评论】【↑返回顶部
评 分: 12 345
评论内容:(不能超过500字,请自觉遵守互联网相关政策法规。[按 Ctrl+Enter 可直接提交]
注意:请勿在本站发布政治话题、色情及违反法律的内容。
IT知道网 声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。
推 荐 文 章
·javascript脚本实现右键弹出...
·javascript结合Ajax制作的可...
·javascript实现页面载入等待...
·javascript实现一个IP只弹窗...
·javascript导航条比较实用的...
·怎样把select选择下拉框中的...
·实用代码,让网站具有简繁体在
·JavaScript脚本调试常用方法...
·javascript版生成Excel报表
·Javascript时间差计算函数代...
·Javascript实现日期的联动选...
·javascript实现的网页软键盘...
·javascript标记高亮关键词示...
·如何防止页面被别人的frame引
·javascrpt获取选中的内容代码
热 门 文 章
·Ext2.0框架的Grid使用介绍祥...
·javascript使用xml数据岛的简...
·JS实现多行的HTML静态表格分...
·javascript实现多张图片轮流...
·Adobe Reader利用javascript...
·javascript读写TEXT文本文件...
·javascript实现动态多附件上...
·Javascript在IE和FireFox中的...
·javascript解析身份证号码得...
·javascript实现类似IE7中的Ta...
·js操作innerHTML 引起的未知...
·实现静态页面点击数的自动更...
·鼠标右下角显示层,javascrip...
·javascript清除界面上所有输...
·Javascript里怎么取Array的某...
网站首页 - 关于本站 - 加入收藏 - 网站地图 - 友情连接 - 在线留言 - 联系我们 - 返回顶部
Copyright © 2007 IT知道网.[冀ICP备07026896号]. All Rights Reserved .