flash新闻展示

从数据库中查出图片信息,拼装成字符串
<script type="text/javascript">
window.onload = function(){
var imgs = "";
//var url;
//var title = "";
<%
LashimgSrv ls = AppContext.getBean(LashimgSrv.class);
List<Lashimg> list = ls.queryObjs(Cnd.where("state", "=", 1).asc(
"sno"));
for (Lashimg li : list) {%>
imgs += "<%=pathStr%><%=li.getUrl()%>" + "|";
<%}%>
if(imgs.length > 10){
imgs = imgs.substring(0,imgs.length-1);
}
var focus_width202 = 1000;
var focus_height202 = 200;
var text_height202 = 0;//显示文本高度
var swf_height202 = focus_height202 + text_height202;

var pics202 = imgs;
var htmlStr = "";
// var links202 = url;
//图片对应的网站
// var texts202 = title;
htmlStr += "<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_width202 + "\" height=\"" + swf_height202 + "\">";
/*这里必须填写flash.swf的正确路径*/
htmlStr += "<param name=\"allowScriptAccess\" value=\"sameDomain\"/><param name=\"movie\" value=\"<%=pathStr%>/img/flash.swf\"/><param name=\"quality\" value=\"high\"/><param name=\"bgcolor\" value=\"white\"/>";
htmlStr += "<param name=\"menu\" value=\"false\"/><param name=wmode value=\"opaque\"/>";
htmlStr += "<param name=\"FlashVars\" value=\"pics=" + pics202 + "&borderwidth=" + focus_width202 + "&borderheight=" + focus_height202 + "&textheight=" + text_height202 + "\"/>";
htmlStr += "<embed src=\"<%=pathStr%>/img/flash.swf\" wmode=\"opaque\" FlashVars=\"pics=" + pics202 + "&borderwidth=" + focus_width202 + "&borderheight=" + focus_height202 + "&textheight=" + text_height202 + "\" menu=\"false\" bgcolor=\"white\" quality=\"high\" width=\"" + focus_width202 + "\" height=\"" + swf_height202 + "\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
htmlStr += "</object>";

var flashdiv = document.getElementById("imageflash");
flashdiv.innerHTML=htmlStr;


}
</script>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值