网上现在很流行 一个FLASH头条新闻的JS代码
演示地址: http://sports.sina.com.cn/
代码如下:
<script type="text/javascript"> <!-- var focus_width=245 //图片宽 var focus_height=184 //图片高 var text_height=18 //文字高 var swf_height = focus_height+text_height
var pics="http://www.3asj.com/images/zp/yrt.jpg|http://www.laxjyj.com/bbs/attachment/Fid_18/18_119_672dd67eb230a56.jpg|http://www.laxjyj.com/bbs/attachment/Fid_106/106_669_9b68bf324988413.jpg|http://www.laxjyj.com/bbs/attachment/Fid_106/106_669_1408b3f357e2fac.jpg|http://www.laxjyj.com/bbs/attachment/Fid_18/18_17_beabdfe0267aa8b.jpg" //此处为图片 var links="http://www.laxjyj.com/bbs/read.php?tid=25303|http://www.laxjyj.com/bbs/read.php?tid=25302|http://www.laxjyj.com/bbs/read.php?tid=24682|http://www.laxjyj.com/bbs/read.php?tid=24680|http://www.laxjyj.com/bbs/read.php?tid=24642" //此处为连接 var texts="隆安县教育局开学前上好校长培训第一课|早部署早行动 实现教育工作开门红|亲切的慰问 莫大的鼓舞|县二小召开退休教师新春座谈会| 让感恩之风永不消逝--隆安二中开展感恩教育征文比赛等活动" //此处为标题 document.write(<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="+ focus_width +" height="+ swf_height +">); document.write(<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="http://image2.sina.com.cn/bj/zonghe/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#DADADA">); document.write(<param name="menu" value="false"><param name=wmode value="opaque">); document.write(<param name="FlashVars" value="pics=+pics+&links=+links+&texts=+texts+&borderwidth=+focus_width+&borderheight=+focus_height+&textheight=+text_height+">); document.write(<embed src="http://image2.sina.com.cn/bj/zonghe/pixviewer.swf" wmode="opaque" FlashVars="pics=+pics+&links=+links+&texts=+texts+&borderwidth=+focus_width+&borderheight=+focus_height+&textheight=+text_height+" menu="false" bgcolor="#DADADA" quality="high" width="+ focus_width +" height="+ swf_height +" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />); document.write(</object>);
//--> </script>
问题:
假如我想把他结合程序 图片地址 和 连接地址 都不用手工添加 直接结合帝国的程序
应该怎么弄了? 假如你没时间回答 给个例子看看 谢谢了
|