| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1461 人关注过本帖
标题:关于新闻图片滚动框的问题,大家帮下忙
只看楼主 加入收藏
懂也不懂
Rank: 4
等 级:业余侠客
威 望:2
帖 子:73
专家分:224
注 册:2010-12-1
收藏
得分:0 
给你两种方式。
 第一:不实现你的的那个界面,换一种界面,即让新闻图片滚动,用html中的marquee,网上都有相关内容可以学习;
 第二:实现你的界面,用JS;
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.

<HTML xmlns="http://www.
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<base target="_blank" />
<meta name="keywords" content="NBA,nba,NBA常规赛,nba常规赛,火箭,0405赛季NBA常规赛,姚明,NBA记录,比分直播,NBA积分榜,NBA赛程">
<meta name="description"
content="NBA","NBA火热赛事","NBA图片","火箭-姚明","NBA热点新闻","NBA每日综述","NBA辩论","NBA评论","NBA排行榜","NBA技
术统计","王治郅-热队","NBA论坛">
<meta name="robots" content="index, follow" />
<meta name="googlebot" content="index, follow" />
<link href="http://sports. rel="stylesheet" type="text/css" />
<link href="http://cimg2. rel="stylesheet" type="text/css" />
<link href="http://sports. rel="stylesheet" type="text/css" /></head>
<div class="col3">
<script language="javascript">
var nn;
nn=1;
setTimeout('change_img12()',6000);
function change_img12()
{
if(nn>4) nn=1
setTimeout('setFocus12('+nn+')',6000);
nn++;
tt=setTimeout('change_img12()',6000);
}
function setFocus12(i)
{
selectLayer12(i);
}
function selectLayer12(num)
{
for(var id = 1;id<=4;id++)
{
   var ss="focusPic"+id;
   if(id==num)
   document.getElementById(ss).style.display="block";
   else
   document.getElementById(ss).style.display="none";
}  
}
</script>
<div class="focusPic" id="focusPic1" style="display:block">
<div class="pic">
<a href="#"><img src="#" alt="AA" width="280" height="390" border="0" /></a>
</div>   
<div class="text">
<h2><a href="#" class="cWhite">AA</a></h2>
<span><img src="#" alt="BB" width="42" height="25" border="0" /></span>
</div>
<div class="textNum">
<div class="num bg1">
<ul>
<li>1</li><li><a href="javascript:setFocus12(2);" target="_self">2</a></li><li><a href="javascript:setFocus12(3);" target="_self">3</a></li><li><a href="javascript:setFocus12(4);" target="_self">4</a></li>
</ul>
</div>

</div>
</div>
<div class="focusPic" id="focusPic2" style="display:none">
<div class="pic">
<a href="#"><img src="#" alt="CC" width="280" height="390" border="0" /></a>
</div>   
<div class="text">
<h2><a href="#" class="cWhite">CC</a></h2>
<span><img src="#" alt="BB" width="42" height="25" border="0" /></span>
</div>
<div class="textNum">
<div class="num bg2">
<ul>
<li><a href="javascript:setFocus12(1);" target="_self">1</a></li><li>2</li><li><a href="javascript:setFocus12(3);" target="_self">3</a></li><li><a href="javascript:setFocus12(4);" target="_self">4</a></li>
</ul>
</div>

</div>
</div>
<div class="focusPic" id="focusPic3" style="display:none">
<div class="pic">
<a href="#"><img src="#" alt="DD" width="280" height="390" border="0" /></a>
</div>   
<div class="text">
<h2><a href="#" class="cWhite">DD</a></h2>
<span><img src="#" alt="BB" width="42" height="25" border="0" /></span>
</div>
<div class="textNum">
<div class="num bg3">
<ul>
<li><a href="javascript:setFocus12(1);" target="_self">1</a></li><li><a href="javascript:setFocus12(2);" target="_self">2</a></li><li>3</li><li><a href="javascript:setFocus12(4);" target="_self">4</a></li>
</ul>
</div>

</div>
</div>
<div class="focusPic" id="focusPic4" style="display:none">
<div class="pic">
<a href="#"><img src="#" alt="EE" width="280" height="390" border="0" /></a>
</div>   
<div class="text">
<h2><a href="#" class="cWhite">FF</a></h2>
<span><img src="#" alt="BB" width="42" height="25" border="0" /></span>
</div>
<div class="textNum">
<div class="num bg4">
<ul>
<li><a href="javascript:setFocus12(1);" target="_self">1</a></li><li><a href="javascript:setFocus12(2);" target="_self">2</a></li><li><a href="javascript:setFocus12(3);" target="_self">3</a></li><li>4</li>
</ul>
</div>

</div>
</div>
</body>
</html>
2010-12-31 10:58
logan2009
Rank: 2
等 级:论坛游民
帖 子:46
专家分:62
注 册:2009-4-15
收藏
得分:0 
给你贴一段asp的代码
<a href="javascript:goUrl()" target="_self">
<script type="text/javascript">
<%
'幻灯片产品图片
sql="select top 5 * from [Pro] where Passed="&TrueType&" order by UpdateTime desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
for i=1 to 5
%>
imgUrl<%=i%>="<%=rs("DefaultPicUrl")%>";
imgtext<%=i%>="<%if len(rs("title"))>=18 then response.write left(rs("title"),18)&"..." else response.write rs("title")%>"
imgLink<%=i%>=escape("Show.asp?ID=<%=rs("ID")%>");
<%
rs.movenext
next
else
response.write "暂时没有图片!"
end if
%>
var focus_width=210
var focus_height=185
var text_height=16
var swf_height = focus_height+text_height
var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="images/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
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="images/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www. />');  document.write('</object>');
</script>
</a>
2010-12-31 16:59
shiyuehai
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:96
专家分:116
注 册:2009-9-4
收藏
得分:0 
回复 11楼 懂也不懂
谢谢你,我自己已经弄好了,不过不好意思,没分给你了,之前就结了
2011-01-01 10:14
thh134
Rank: 2
等 级:论坛游民
帖 子:6
专家分:30
注 册:2010-12-27
收藏
得分:0 
回复 7楼 shiyuehai
怎么导入到flash?就是直接从数据库里取出来了
2011-01-01 12:16
快速回复:关于新闻图片滚动框的问题,大家帮下忙
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019298 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved