| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 578 人关注过本帖
标题:图片新闻问题???
只看楼主 加入收藏
kuizhe425
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2007-5-9
收藏
 问题点数:0 回复次数:1 
图片新闻问题???

<SCRIPT LANGUAGE="JavaScript">
<!--
function ResumeError() {
return true;
}
window.onerror = ResumeError;
// -->
</SCRIPT>

<script language=javascript>
isns = navigator.appName == "Netscape";
function ztstr(id,picurl,linkurl)
{
this.id=id
this.picurl=picurl
this.linkurl=linkurl
}
zhuanti=new Array()
imgcount=1;
frequency=5*1000;//30秒//在这里修改图片的路径和链接
<%dim tpxw
sql="select top 3 Conews.* from Conews where passed<>0 and Elite<>0 and modid='011003' and IncludePic<>0 order by Articleid desc"
OpenRS rs,sql,1,1
if not rs.eof then
rs.movefirst
do while not rs.eof
%>
zhuanti[imgcount]=new ztstr(imgcount,'../News/<%=rs("DefaultPicUrl")%>','../News/NewsInfo.asp?id=<%=rs("Articleid")%>&modid=011003')
imgcount+=1;

<%
rs.movenext
loop
else
%>
zhuanti[imgcount]=new ztstr(imgcount,'../Image/Imgqxe6/nopic.jpg','#')
<%
end if
rs.close
set rs=nothing
%>
imgcount=zhuanti.length-1
for(i=1;i<=imgcount;i++)
{
eval("img"+i+"=new Image()");
eval("img"+i+".src=zhuanti["+i+"].picurl")
}

nn=1;
var rand1 = 0;
var useRand = 0;
function swapPic() {
var imgnum = zhuanti.length - 1;
do {
var randnum = Math.random();
rand1 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand1 == useRand);
useRand = rand1;
// alert(useRand);
nn=useRand;
change_img();
}
function change_img()
{
eval('document.pic.src=img'+nn+'.src');
nn++;
if(nn>imgcount) nn=1
if(!isns)
{
pic.filters.item(0).apply()
pic.style.visibility='visible'
pic.filters.item(0).play()
setTimeout("pic.style.visibility='hidden'",frequency);
}
else
document.pic.visibility='visible'
tt=setTimeout('change_img()',frequency)
}

function pictarget()
{
tt=nn-1
if(tt<1) tt=imgcount
cururl=zhuanti[tt].linkurl
window.open(cururl);
}
function ini()
{
if(!isns)
{
spacewidth=Math.round((divmask.offsetWidth-770)/2)
dmwidth=770+spacewidth
dmheight=divmask.offsetHeight
totalstep=50
timeout=50
dmstepw=Math.round(770/totalstep)
dmsteph=Math.round(dmheight/totalstep)
setTimeout('hidimg()',3000)
}
else swapPic()
}
function hidimg()
{
dmwidth-=dmstepw
dmheight-=dmsteph
eval('divmask.style.clip="rect(0,'+dmwidth+','+dmheight+',0)"')
hdrun=setTimeout('hidimg()',timeout)
if(dmwidth<=spacewidth&&dmheight<=0)
{
divmask.style.visibility='hidden'
clearTimeout(hdrun)
swapPic()
}
}
</script>


这是图片幻灯片的特效。

这个代码只能调出图片,我想调出图片加上图片的标题,不知道怎么写。。。请高手指教。

搜索更多相关主题的帖子: Netscape picurl linkurl function 
2007-08-22 11:00
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 

[QUOTE]<SCRIPT language="VBScript">
Dim FileList,FileListArr,TxtList,TxtListArr,LinkList,LinkArr
FileList = "../syspic/NewsFile/NEWS200708181515048230/20078181518751217.jpg,../syspic/NewsFile/NEWS200708081658071454/20078816591636795.jpg,../syspic/NewsFile/NEWS200708072311134178/20078723122548844.jpg,../syspic/NewsFile/NEWS200708041438222464/2007841439711714.jpg,../syspic/NewsFile/NEWS200708011044182109/2007811046015989.jpg"
LinkList = "../news/det_news.asp?news_sort=201&news_code=NEWS200708181515048230,../news/det_news.asp?news_sort=201&news_code=NEWS200708081658071454,../news/det_news.asp?news_sort=204&news_code=NEWS200708072311134178,../news/det_news.asp?news_sort=201&news_code=NEWS200708041438222464,../news/det_news.asp?news_sort=201&news_code=NEWS200708011044182109"
TxtList = "中国十个代表性城市房价走势分析,商品房产权登记酝酿重大变革 预售房...,标准统计制度缺失 走出房产数据“平...,北京推出保障房配建政策 房企期待细...,北京;加息一周公积金贷款增两成"
FileListArr = Split(FileList,",")
LinkArr = Split(LinkList,",")
TxtListArr = Split(TxtList,",")
Dim CanPlay
CanPlay = CInt(Split(Split(navigator.appVersion,";")(1)," ")(2))>5
Dim FilterStr
FilterStr = "RevealTrans(duration=2,transition=23)"
FilterStr = FilterStr + ";BlendTrans(duration=2)"
If CanPlay Then
FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Fade(duration=2,overlap=0)"
FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Wipe(duration=3,gradientsize=0.25,motion=reverse)"
Else
Msgbox "幻灯片播放具有多种动态图片切换效果,但此功能需要您的浏览器为IE5.5或以上版本,否则您将只能看到部分的切换效果。",64
End If
Dim FilterArr
FilterArr = Split(FilterStr,";")
Dim PlayImg_M
PlayImg_M = 5 * 1000
Dim I
I = 1
Sub ChangeImg
Do While FileListArr(I)=""
I = I + 1
If I>UBound(FileListArr) Then I = 0
Loop
Dim J
If I>UBound(FileListArr) Then I = 0
Randomize
J = Int(Rnd * (UBound(FilterArr)+1))
Img.style.filter = FilterArr(J)
Img.filters(0).Apply
Img.Src = FileListArr(I)
Img.filters(0).play
Link.Href = LinkArr(I)
Txt.filters(0).Apply
Txt.innerHTML = TxtListArr(I)
Txt.filters(0).play
I = I + 1
If I>UBound(FileListArr) Then I = 0
TempImg.Src = FileListArr(I)
TempLink.Href = LinkArr(I)
SetTimeout "ChangeImg", PlayImg_M,"VBScript"
End Sub
</SCRIPT>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../Image_Auto_Image/News/NewsIndex_13.gif" width="277" height="9"></td>
</tr>
<TR ID="NoScript">
<TD height="200" background="../Image_Auto_Image/News/NewsIndex_17.gif" Align="Center">对不起,图片浏览功能需脚本支持,但您的浏览器已经设置了禁止脚本运行。请您在浏览器设置中调整有关安全选项。</TD>
</TR>
<TR Style="Display:none" ID="CanRunScript">
<td height="200" background="../Image_Auto_Image/News/NewsIndex_17.gif" Align="Center"><a id="Link" target="_blank"><Img ID="Img" Width="258" Height="200" Border="0" ></a></td>
</tr>
<TR Style="Display:none">
<td height="5" background="../Image_Auto_Image/News/NewsIndex_17.gif" Align="Center">
<a id=TempLink target="_blank"><Img ID="TempImg" Border="0"></a>
</td>
</tr>
<tr>
<td height="5" background="../Image_Auto_Image/News/NewsIndex_26.gif"></td>
</tr>
<tr>
<td height="20" background="../Image_Auto_Image/News/NewsIndex_17.gif" Align="Center">
<div ID="Txt" style="PADDING-LEFT: 5px; Z-INDEX: 1; FILTER: progid:DXImageTransform.Microsoft.Fade(duration=1,overlap=0); POSITION:"><a href="../news/det_news.asp?news_sort=201&news_code=NEWS200708181515048230" target=_blank>中国十个代表性城市房价走势分析</a></div>
</td>
</tr>
<tr>
<td><img src="../Image_Auto_Image/News/NewsIndex_22.gif" width="277" height="16"></td>
</tr>
<tr>
<td height="4"></td>
</tr>
</table>
<Script Language="VBScript">
NoScript.Style.Display = "none"
CanRunScript.Style.Display = ""
Img.Src = FileListArr(0)
Link.Href = LinkArr(0)
SetTimeout "ChangeImg",PlayImg_M,"VBScript"
</Script>[/QUOTE]


专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2007-08-22 11:33
快速回复:图片新闻问题???
数据加载中...
 
   



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

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