一个不错的幻灯片效果(JS脚本)



<! DOCTYPEhtmlPUBLIC " -//W3C//DTDXHTML1.0Transitional//EN " " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
< htmlxmlns = " http://www.w3.org/1999/xhtml " >
< head >
< title > 图片新闻 </ title >
< metahttp - equiv = " Content-Type " content = " text/html;charset=gb2312 " >
< metacontent = " 图片新闻 " name = " keywords " >
< metacontent = " 新闻中心图片新闻 " name = " description " >
< metacontent = " 1,231,1 " name = " publishid " >

< styletype = " text/css " >
<!--
body
... {
background
-image:url(FQNP-2007-IMAGES/l1.gif);
background
-repeat:repeat-y;
background
-position:49px;
}

.itemOff
... {
color:#0099CC;
cursor:hand;
background
-color:#ECF7FF;
height:20px;
margin
-right:1px;
margin
-left:1px;
padding
-right:5px;
padding
-left:5px;
border:1pxsolid#ABDEFA;
}
.itemOn ... {
color:#FF0000;
cursor:hand;
background
-color:#ABDEFA;
height:20px;
margin
-right:1px;
margin
-left:1px;
padding
-right:5px;
padding
-left:5px;
border:1pxsolid#ABDEFA;
}

body,td,th
... {
font
-family:Arial,Helvetica,sans-serif;
font
-size:12px;
}

-->
</ style >
</ head >
< bodyonload = " SlidePic(0);inislide(); " >
< scriptlanguage = " JavaScript " type = " text/javascript " >
<!--
/**/ /*Databegin*/
var sPicArr = new Array();

sPicArr[
0 ] = new Array( ' UpLoad/20071115165029.JPG ' , ' 夜景 ' , '' , ' Shownews.aspx?ID=1231 ' , '' );
sPicArr[
1 ] = new Array( ' UpLoad/20071115164742.JPG ' , ' 香山红叶 ' , '' , ' Shownews.aspx?ID=1230 ' , '' );
sPicArr[
2 ] = new Array( ' UpLoad/20071022100128.JPG ' , ' 夕阳 ' , '' , ' Shownews.aspx?ID=1158 ' , '' );
sPicArr[
3 ] = new Array( ' UpLoad/20071015091114.JPG ' , ' 那拉提草原风景 ' , '' , ' Shownews.aspx?ID=1138 ' , '' );
sPicArr[
4 ] = new Array( ' UpLoad/20071015090219.JPG ' , ' 喀纳斯湖风光 ' , '' , ' Shownews.aspx?ID=1137 ' , '' );
sPicArr[
5 ] = new Array( ' UpLoad/20070920103404.JPG ' , ' 喀纳斯湖—月亮湾 ' , '' , ' Shownews.aspx?ID=1113 ' , '' );


/**/ /*Dataend*/


function GetObj(objName) ... {
if(document.getElementById)...{
returneval('document.getElementById("'+objName+'")');
}
elseif(document.layers)...{
returneval("document.layers['"+objName+"']");
}
else...{
returneval('document.all.'+objName);
}

}

var plPic = new Image();
var gIndex = 0 ;
function SlidePic(index) ... {
gIndex
=index;
//patchbydorian1017
if('MicrosoftInternetExplorer'==navigator.appName)
...{
document.images[
"slidePic"].filters.item(0).Apply();
}


document.images[
"slidePic"].src=sPicArr[index][0];
document.images[
"slidePic"].alt=sPicArr[index][1];
GetObj(
"slidePicLink").href=sPicArr[index][3];
GetObj(
"slideTitle").innerHTML=sPicArr[index][1];
GetObj(
"slideDesc").innerHTML=sPicArr[index][2];
//GetObj("slideLink").innerHTML="[<ahref='"+sPicArr[index][3]+"'target=_blanktitle='全文'>全文</a>]";


if((index+1)<sPicArr.length)plPic.src=sPicArr[index+1][0];//preload;

for(vari=0;i<sPicArr.length;i++)...{
GetObj(
"item"+i).className="itemOff";
GetObj(
"item"+i).onmouseover=function()...{returnfalse;}
GetObj(
"item"+i).onmouseout=function()...{returnfalse;}
}

GetObj(
"item"+index).className="itemOn";
/**//*fixedbyAmourGUO,051017
GetObj("item"+index).οnmοuseοver=function(){
pauseslide();
}
GetObj("item"+index).οnmοuseοut=function(){
inislide();
}
*/

if('MicrosoftInternetExplorer'==navigator.appName)
...{
document.images[
"slidePic"].filters.item(0).play();
}


}


function NextPic() ... {
gIndex
=((gIndex+1)>=sPicArr.length?0:(gIndex+1));
SlidePic(gIndex);
}


function PrevPic() ... {
//alert(gIndex);
gIndex=((gIndex-1)<0?(sPicArr.length-1):(gIndex-1));
//alert(gIndex);
SlidePic(gIndex);

}

var sid;
function inislide()
... {
if(sid==null)sid=setInterval('NextPic()',6000);//fixedbyAmourGUO,051017
}

function pauseslide()
... {
clearInterval(sid);
sid
=null;//fixedbyAmourGUO,051017
}


// -->
</ script >
< tablewidth = " 100% " cellspacing = " 0 " align = " center " >
< tbody >
< tralign = " center " >
< tdalign = " center " valign = " middle " >
< divalign = " center " >< ahref = " # " title = "" target = " _blank " id = " slidePicLink " >
< imgsrc = " images o_picture1.gif " alt = "" name = " slidePic " width = " 200 " height = " 150 "
border
= " 0 " align = " middle " id = " slidePic " style = " filter:revealtrans(duration=2.0,transition=12) "
onmouseover
= " pauseslide(); " onmouseout = " inislide(); " ></ a ></ div ></ td >
</ tr >
< tralign = " center " >
< tdonmouseover = " pauseslide(); " onmouseout = " inislide(); " align = " center " >
</ td >
</ tr >
</ tbody >
</ table >
< tablewidth = " 100% " align = " center " cellspacing = " 0 " onmouseover = " pauseslide() " onmouseout = " inislide() " >
<!-- // fixedbyAmourGUO,051017-->
< tbody >
< tr >
< tdwidth = " 23 " >< imgstyle = " cursor:pointer " onclick = " PrevPic();pauseslide();inislide() " height = " 19 "
alt
= " 上一张 " src = " images/gw_news_img_05.gif " width = " 23 " /></ td >
< tdclass = " td-3 " style = " text-align:center
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值