码迷,mamicode.com
首页 > 其他好文 > 详细

图片轮显效果大全

时间:2015-05-13 21:21:27      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:

综合各种效果的图片轮显

技术分享<SCRIPT language="VBScript">
技术分享Dim FileList,FileListArr,TxtList,TxtListArr
技术分享FileList 
= "http://et.21cn.com/portray/images/if/01.jpg,http://et.21cn.com/portray/images/if/02.jpg,http://et.21cn.com/portray/images/if/03.jpg"
技术分享TxtList 
= "<a href=http://www.licns.com/ target=_blank>在这里加入你的连接1</a>,<a href=http://www.licns.com/ target=_blank>在这里加入你的连接2</a>,<a href=http://www.licns.com/ target=_blank>在这里加入你的连接3</a>"
技术分享FileListArr 
= Split(FileList,",")
技术分享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.Pixelate(,enabled=false,duration=2,maxSquare=25)"
技术分享FilterStr 
= FilterStr + ";progid:DXImageTransform.Microsoft.Fade(duration=2,overlap=0)"
技术分享FilterStr 
= FilterStr + ";progid:DXImageTransform.Microsoft.GradientWipe(duration=2,gradientSize=0.25,motion=forward )"
技术分享FilterStr 
= FilterStr + ";progid:DXImageTransform.Microsoft.Stretch(duration=2,stretchStyle=PUSH)"
技术分享FilterStr 
= FilterStr + ";progid:DXImageTransform.Microsoft.Wheel(duration=2,spokes=16)"
技术分享FilterStr 
= FilterStr + ";progid:DXImageTransform.Microsoft.RandomDissolve(duration=2)"
技术分享FilterStr 
= FilterStr + ";progid:DXImageTransform.Microsoft.Spiral(duration=2,gridSizeX=50,gridSizeY=50)"
技术分享FilterStr 
= FilterStr + ";progid:DXImageTransform.Microsoft.Slide(duration=2,bands=1,slideStyle=SWAP)"
技术分享FilterStr 
= FilterStr + ";progid:DXImageTransform.Microsoft.RadialWipe(duration=2,wipeStyle=CLOCK)"
技术分享FilterStr 
= FilterStr + ";progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,Duration=1)"
技术分享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
技术分享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)
技术分享SetTimeout "ChangeImg", PlayImg_M,"VBScript"
技术分享End Sub
技术分享</SCRIPT>
技术分享<TABLE WIDTH="100%" height="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR ID="NoScript"><TD Align="Center" Style="Color:White">对不起,图片浏览功能需脚本支持,但您的浏览器已经设置了禁止脚本执行。请您在浏览器设置中调整有关安全选项。</TD></TR><TR Style="Display:none" ID="CanRunScript"><TD HEIGHT="100%" Align="Center" vAlign="Center"><Img ID="Img" height="290" width="300" Border="0" ></TD></TR><TR Style="Display:none"><TD><Img ID="TempImg" Border="0"></TD></TR><TR><TD HEIGHT="100%" Align="Center" vAlign="Center"><div ID="Txt" style="PADDING-LEFT: 5px; Z-INDEX: 1; FILTER: progid:DXImageTransform.Microsoft.Fade(duration=1,overlap=0); POSITION:"><a href=http://www.licns.com/ target=_blank>在这里加入你的连接1</a></div></TD></TR></TABLE>
技术分享<Script Language="VBScript">
技术分享NoScript.Style.Display = "none"
技术分享CanRunScript.Style.Display = ""
技术分享Img.Src = FileListArr(0)
技术分享SetTimeout "ChangeImg", PlayImg_M,"VBScript"
技术分享</Script>

 

 

 

腾讯的用Flash调用图片轮显

技术分享<script type="text/javascript">
技术分享 
<!--
技术分享 
技术分享 
var focus_width=255
技术分享 
var focus_height=200
技术分享 
var text_height=18
技术分享 
var swf_height = focus_height+text_height
技术分享 
技术分享 
var pics=http://img1.qq.com/sports/20060102/2958063.jpg|http://img1.qq.com/sports/20060101/2955633.jpg|http://img1.qq.com/sports/20051229/2936827.jpg|http://img1.qq.com/sports/20051227/2920636.jpg
技术分享 
var links=http://sports.qq.com/a/20060101/000514.htm|http://sports.qq.com/a/20060101/000053.htm|http://sports.qq.com/a/20051229/000159.htm|http://sports.qq.com/a/20051227/000023.htm
技术分享 
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://sports.qq.com/flash/playswf.swf"><param name=wmode value=transparent><param name="quality" value="high">);
技术分享 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://sports.qq.com/flash/playswf.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>

 最主要的图片轮显

技术分享<script language=JavaScript>
技术分享
var imgUrl=new Array();
技术分享
var imgLink=new Array();
技术分享
var adNum=0;
技术分享imgUrl[
1]="http://image2.sina.com.cn/lx/nx/2006/0207/U1275P8T1D227041F918DT20060220173712.jpg"
技术分享imgLink[
1]="http://eladies.sina.com.cn/bbs/p/2006/0220/17268791.html"
技术分享imgUrl[
2]="http://image2.sina.com.cn/lx/nx/2006/0128/U1275P8T1D226214F918DT20060128200332.jpg"
技术分享imgLink[
2]="http://eladies.sina.com.cn/pic/special/198/554.html";
技术分享imgUrl[
3]="http://image2.sina.com.cn/lx/beauty1/2006/0218/U1275P8T1D229151F916DT20060220180508.jpg"
技术分享imgLink[
3]="http://blog.sina.com.cn/u/45f2dd64010001yg";
技术分享imgUrl[
4]="http://image2.sina.com.cn/lx/nx/2006/0210/U1275P8T1D227877F1086DT20060213161341.jpg"
技术分享imgLink[
4]="http://eladies.sina.com.cn/bbs/2006/0213/16048576.html";
技术分享     
var imgPre=new Array();
技术分享   
for (i=1;i<4;i++){
技术分享imgPre[i]
=new Image();
技术分享      imgPre[i].src
=imgUrl[i];
技术分享   }

技术分享
技术分享
技术分享
function setTransition(){
技术分享   
if (document.all){
技术分享      imgUrlrotator.filters.revealTrans.Transition
=Math.floor(Math.random()*20);
技术分享      imgUrlrotator.filters.revealTrans.apply();
技术分享   }

技术分享}

技术分享
技术分享
function playTransition(){
技术分享   
if (document.all)
技术分享      imgUrlrotator.filters.revealTrans.play()
技术分享}

技术分享
技术分享
技术分享
function nextAd(){
技术分享   
if(adNum<imgUrl.length-1)adNum++ ;
技术分享      
else adNum=1;
技术分享   setTransition();
技术分享   document.images.imgUrlrotator.src
=imgUrl[adNum];
技术分享   playTransition();
技术分享   theTimer
=setTimeout("nextAd()"6000);
技术分享}

技术分享
技术分享
function jump2url(){
技术分享   jumpUrl
=imgLink[adNum];
技术分享   jumpTarget
=_blank;
技术分享   
if (jumpUrl != ‘‘){
技术分享      
if (jumpTarget != ‘‘)window.open(jumpUrl,jumpTarget);
技术分享      
else location.href=jumpUrl;
技术分享   }

技术分享}

技术分享
function displayStatusMsg() 
技术分享   status
=imgLink[adNum];
技术分享   document.returnValue 
= true;
技术分享}

技术分享
技术分享
</script>
技术分享        
<a onMouseOver="displayStatusMsg();return document.returnValue" 
技术分享      href
="javascript:jump2url()"><img 
技术分享      style
="FILTER: revealTrans(duration=2,transition=20);border:1 solid gray;" height=242 
技术分享      src
="javascript:nextAd()" width=191
技术分享      name
=imgUrlrotator></a>

 

21cn写真频道图片切换代码

技术分享<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
技术分享
<html>
技术分享
<head>
技术分享
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
技术分享
<title>无标题文档</title>
技术分享
<META http-equiv=Content-Type content="text/html; charset=gb2312">
技术分享
<META content="MSHTML 6.00.2800.1476" name=GENERATOR></HEAD>
技术分享
<BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
技术分享
<TABLE width=330 height="250" border=0 cellPadding=0 cellSpacing=0 bgcolor="434343">
技术分享  
<TBODY>
技术分享    
<TR> 
技术分享      
<TD width=330 bgcolor="434343">
 
技术分享        
<CENTER>

技术分享          
<DIV id=oTransContainer 
技术分享      
style
="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0, 
技术分享                        wipeStyle=0, motion=‘forward‘); WIDTH: 330px; HEIGHT: 250px"
><

技术分享      
href="?SenFe=List&Id=466298" target=_blank><img src="http://et.21cn.com/portray/images/if/01.jpg" width
=330 
技术分享      
height=250 border=0 align="absmiddle" id
=oDIV1 
技术分享      
></a> <

技术分享      
href="?SenFe=List&Id=399878"
 
技术分享      target
=_blank><img src="http://et.21cn.com/portray/images/if/02.jpg" width
=330 
技术分享      
height=250 border=0 align="absmiddle" id
=oDIV2 
技术分享      
style="DISPLAY: none"></a><
a
技术分享      
href="?SenFe=List&Id=466294"
 
技术分享      target
=_blank><img src="http://et.21cn.com/portray/images/if/03.jpg" width
=330 
技术分享      
height=250 border=0 align="absmiddle" id
=oDIV3 
技术分享      
style="DISPLAY: none"></a><

技术分享      
href="?SenFe=List&Id=466296"
 
技术分享      target
=_blank><img src="http://et.21cn.com/portray/images/if/04.jpg" width
=330 
技术分享      
height=250 border=0 align="absmiddle" id
=oDIV4
技术分享      
style="DISPLAY: none"></a></DIV>

技术分享        
</CENTER>
技术分享        
<SCRIPT>
技术分享
var NowFrame = 1;
技术分享
var MaxFrame = 4
;
技术分享
var bStart = 0
;
技术分享
技术分享
function fnToggle() 
{
技术分享    
var next = NowFrame + 1
;
技术分享
技术分享    
if(next == MaxFrame+1

技术分享    
{
技术分享        NowFrame 
=
 MaxFrame;
技术分享        next 
= 1
;
技术分享    }

技术分享
技术分享    
if(bStart == 0)
技术分享    
{
技术分享        bStart 
= 1
;
技术分享        
技术分享        setTimeout(
fnToggle()6000
);
技术分享
技术分享        
return
;
技术分享    }

技术分享    
else
技术分享    
{
技术分享        oTransContainer.filters[
0
].Apply();
技术分享
技术分享        document.images[
oDIV+next].style.display = ""
;
技术分享        document.images[
oDIV+NowFrame].style.display = "none"

技术分享
技术分享        oTransContainer.filters[
0].Play(duration=2
);
技术分享
技术分享        
if(NowFrame ==
 MaxFrame) 
技术分享            NowFrame 
= 1
;
技术分享        
else

技术分享            NowFrame
++;
技术分享    }
    setTimeout(fnToggle()6000);
技术分享}

技术分享
技术分享fnToggle();
技术分享
</SCRIPT>
技术分享      
</TD>
技术分享    
</TR>
技术分享  
</TBODY>
技术分享
</TABLE>
技术分享
</body>
技术分享
</html>
加上了鼠标的特效的
技术分享<script language="JavaScript">
技术分享
var elady_step=3;    //1:small, 3:middle, 5:big
技术分享
var elady_speed=50;    //20:fast, 50:middle, 80:slow
技术分享
var e_tp=new Array();
技术分享
var e_tplink=new
 Array();
技术分享
var adNum_elady1=0
;  
技术分享
var elady_stop_sh=0
;
技术分享
var elady_star_sh=1
;
技术分享
技术分享
function elady1_moveImg()
{
技术分享
if ((!document.all&&!document.getElementById)||(elady_stop_sh==0))    return
;
技术分享
if (elady_star_sh==1)
{
技术分享document.all.elady1_divimg.style.pixelTop
=parseInt(document.all.elady1_divimg.style.pixelTop)+elady_step;}

技术分享
else if (elady_star_sh==2){
技术分享document.all.elady1_divimg.style.pixelLeft
=parseInt(document.all.elady1_divimg.style.pixelLeft)+elady_step;}

技术分享
else if (elady_star_sh==3){
技术分享document.all.elady1_divimg.style.pixelTop
=parseInt(document.all.elady1_divimg.style.pixelTop)-elady_step;}

技术分享
else{
技术分享document.all.elady1_divimg.style.pixelLeft
=parseInt(document.all.elady1_divimg.style.pixelLeft)-elady_step;}

技术分享
if (elady_star_sh<4)    elady_star_sh++;
技术分享
else    elady_star_sh=1
;
技术分享setTimeout(
"elady1_moveImg()",elady_speed);}

技术分享
技术分享e_tplink[
0]="http://www.licns.com";
技术分享e_tp[
0]="http://et.21cn.com/portray/images/if/01.jpg"
;
技术分享e_tplink[
1]="http://www.licns.com"
;
技术分享e_tp[
1]="http://et.21cn.com/portray/images/if/02.jpg"
;
技术分享e_tplink[
2]="http://www.licns.com"
;
技术分享e_tp[
2]="http://et.21cn.com/portray/images/if/03.jpg"
;
技术分享e_tplink[
3]="http://www.licns.com"
;
技术分享e_tp[
3]="http://et.21cn.com/portray/images/if/04.jpg"
;
技术分享
技术分享
var currentimage=new
 Array();   
技术分享
for (i=0;i<=3;i++)
{currentimage[i]=new Image();
技术分享      currentimage[i].src
=
e_tp[i];
技术分享         }

技术分享         
function elady1_set(){   if (document.all)
技术分享         
{      e_tprotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
技术分享               e_tprotator.filters.revealTrans.apply();   }

技术分享               }

技术分享               
function elady1_playCo()
技术分享               
{   if (document.all)      e_tprotator.filters.revealTrans.play()
技术分享               }
function elady1_nextAd(){   if(adNum_elady1<e_tp.length-1)adNum_elady1++ ;
技术分享                     
else adNum_elady1=0
;
技术分享                        elady1_set();
技术分享                           document.images.e_tprotator.src
=
e_tp[adNum_elady1];
技术分享                              elady1_playCo();
技术分享                                 theTimer
=setTimeout("elady1_nextAd()"4000);}

技术分享                                 
function elady1_linkurl(){   jumpUrl=e_tplink[adNum_elady1];
技术分享                                    jumpTarget
=_blank
;
技术分享                                       
if (jumpUrl != ‘‘)
{      if (jumpTarget != ‘‘)window.open(jumpUrl,jumpTarget);
技术分享                                             
else location.href=
jumpUrl;
技术分享                                                }
}

技术分享
function elady1_listMsg() 
技术分享
{   status=e_tplink[adNum_elady1];
技术分享document.returnValue 
= true;}

技术分享document.write(
"<div id=‘elady1_divimg‘ style=‘position:relative‘>");
技术分享document.write(
<a onMouseOver="elady1_listMsg();return document.returnValue" href="javascript:elady1_linkurl()" target="_self">
);
技术分享document.write(
<img style="FILTER: revealTrans(duration=2,transition=20)" src="javascript:elady1_nextAd()" border=0 name=e_tprotator onMouseover="elady_stop_sh=1;elady1_moveImg()" onMouseout="elady_stop_sh=0" ></a>
);
技术分享document.write(
"</div>"
);
技术分享
</script>
图片和文字一起显示的
技术分享<SCRIPT LANGUAGE=JavaScript>
技术分享
var imgUrl=new Array();
技术分享
var imgLink=new Array();
技术分享
var imgtext=new Array();
技术分享
var imgsumm=new Array();
技术分享
var adNum=0;
技术分享
技术分享
技术分享imgUrl[
1]="http://et.21cn.com/portray/images/if/01.jpg";
技术分享imgtext[
1]="[组图]第16期 我型我塑 "
技术分享imgLink[
1]="http://www.licns.com/";
技术分享imgsumm[
1]="   摩羯座的猫猫是个安静的女孩,面对镜头总是略带羞涩。";
技术分享
技术分享
技术分享
技术分享imgUrl[
2]="http://et.21cn.com/portray/images/if/02.jpg";
技术分享imgtext[
2]="实录:从“三陪女”到“二奶”"
技术分享imgLink[
2]="http://www.licns.com";
技术分享imgsumm[
2]="   “二奶”的日子是快乐的,但后遗症却是最深的痛……";
技术分享
技术分享
技术分享imgUrl[
3]="http://et.21cn.com/portray/images/if/03.jpg";
技术分享imgtext[
3]="家饰:[组图]我爱抱心肝宝贝"
技术分享imgLink[
3]="http://www.licns.com/";
技术分享imgsumm[
3]="   我们已经不再满足于中规中矩,四角形模样的抱枕...";
技术分享
技术分享
var imgPre=new Array();
技术分享
var count=0;
技术分享
for (i=1;i<=3;i++{
技术分享
if( (imgUrl!=""&& (imgLink!="") ) {
技术分享count
++;
技术分享}
 else {
技术分享
break;
技术分享}

技术分享}

技术分享
function playTran(){
技术分享
if (document.all)
技术分享imgInit.filters.revealTrans.play();
技术分享}

技术分享
var key=0;
技术分享
function nextAd(){
技术分享
if(adNum<count)adNum++ ;
技术分享
else adNum=1;
技术分享
技术分享
if( key==0 ){
技术分享key
=1;
技术分享}
 else if (document.all){
技术分享imgInit.filters.revealTrans.Transition
=20;
技术分享imgInit.filters.revealTrans.apply();
技术分享playTran();
技术分享
技术分享}

技术分享document.images.imgInit.src
=imgUrl[adNum];
技术分享focustext.innerHTML
=imgtext[adNum];
技术分享focussumm.innerHTML
=imgsumm[adNum];
技术分享theTimer
=setTimeout("nextAd()"7000);
技术分享}

技术分享
技术分享
技术分享
function goUrl(){
技术分享window.open(imgLink[adNum],
_blank);
技术分享}

技术分享
</SCRIPT> <A TARGET=_self HREF="javascript:goUrl()"><IMG STYLE="FILTER: revealTrans(duration=1,transition=5);border-color:black;color:#000000" SRC="javascript:nextAd()" WIDTH=300 HEIGHT=250 BORDER=0 CLASS=img01 NAME=imgInit></A> 
技术分享
<A TARGET=_self HREF="javascript:goUrl()"><FONT COLOR=#B41A7A CLASS=sfont><SPAN ID=focustext></SPAN></FONT></A><A TARGET=_self HREF="javascript:goUrl()"><FONT COLOR=#777777 CLASS=sfont><SPAN ID=focussumm></SPAN></FONT></A>

相似于Flash制作的一个图片展示效果

技术分享<html>
技术分享
<head>
技术分享
<title>相似于Flash制作的一个图片展示效果</title>
技术分享
<meta name="Author" content="http://www.webjx.com">
技术分享
<meta http-equiv="imagetoolbar" content="no">
技术分享
<style type="text/css">
技术分享 body 
{cursor:crosshair;margin:0; padding:0; position:absolute; overflow:hidden; background:#222; left:0; top:0; width:100%; height:100%;zIndex:-2;}
技术分享
</style>
技术分享
技术分享
<script type="text/javascript">
技术分享
<!--
技术分享window.onerror 
= new Function("return true");
技术分享screen.bufferDepth 
= 16;
技术分享document.onselectstart 
= function () return false; }
技术分享
技术分享
////////////////////////////
技术分享
var NX     = 3;
技术分享
var NY     = 3;
技术分享
var SP     = 20;
技术分享
var DELAY  = 96;
技术分享
////////////////////////////
技术分享

技术分享
var object = new Array();
技术分享
var nI     = 0;
技术分享
var run    = false;
技术分享
var xrun   = 0;
技术分享
var dR     = 1;
技术分享
var iW     = 0;
技术分享
var iH     = 0;
技术分享
var oH     = 0;
技术分享
var oW     = 0;
技术分享
技术分享
function CObj(N,y,x){
技术分享
技术分享 
this.obj = document.createElement("span");
技术分享 
this.obj.onclick = new Function("object["+N+"].GE1()");
技术分享 
this.obj.onmousedown = new Function("return false;");
技术分享 
this.obj.style.cursor = "pointer";
技术分享 
this.obj.style.position = "absolute";
技术分享 
this.img = document.createElement("img");
技术分享 
this.img.style.position = "absolute";
技术分享 
this.img.src = IMGSRC[N%nI].src;
技术分享 
this.obj.appendChild(this.img);
技术分享 IMGBOX.appendChild(
this.obj);
技术分享
技术分享 
this.object = new Array();
技术分享 
this.x      = x;
技术分享 
this.y      = y;
技术分享 
this.N      = N;
技术分享 
this.W      = 0;
技术分享 
this.H      = 0;
技术分享 
this.L      = 0;
技术分享 
this.T      = 0;
技术分享
技术分享 
function CImg(Parent,y,x){
技术分享  
this.Parent = Parent;
技术分享
技术分享  
this.obj = document.createElement("span");
技术分享  
this.obj.style.position="absolute";
技术分享  
this.obj.style.overflow="hidden";
技术分享  
this.obj.style.cursor = "pointer";
技术分享  
this.img = document.createElement("img");
技术分享  
this.img.style.position = "absolute";
技术分享  
this.img.src = IMGSRC[N%nI].src;
技术分享  
this.obj.appendChild(this.img);
技术分享  
this.Parent.obj.appendChild(this.obj);
技术分享
技术分享  
this.N   = Parent.N;
技术分享  
this.x   = x;
技术分享  
this.y   = y;
技术分享  
this.W   = 0;
技术分享  
this.H   = 0;
技术分享  
this.L   = 0;
技术分享  
this.T   = 0;
技术分享  
this.dx  = 0;
技术分享  
this.dy  = 0;
技术分享  
this.px  = 0;
技术分享  
this.py  = 0;
技术分享  
this.dw  = 0;
技术分享  
this.dh  = 0;
技术分享  
this.pw  = 0;
技术分享  
this.ph  = 0;
技术分享  
this.ipx = 0;
技术分享  
this.ipy = 0;
技术分享  
this.idx = 0;
技术分享  
this.idy = 0;
技术分享
技术分享  
this.GE2 = function (){
技术分享   
with(this){
技术分享    px 
-= dx * dR;
技术分享    py 
-= dy * dR;
技术分享    pw 
+= dw * dR;
技术分享    ph 
+= dh * dR;
技术分享    ipx 
-= idx * dR;
技术分享    ipy 
-= idy * dR;
技术分享
技术分享    
with(obj.style){
技术分享     left   
= Math.round(px);
技术分享     top    
= Math.round(py);
技术分享     width  
= Math.round(pw)+1;
技术分享     height 
= Math.round(ph)+1;
技术分享     
if(dR==-1)if(pw<=W+1)obj.style.visibility="hidden";
技术分享    }

技术分享
技术分享    
with(img.style){
技术分享     left   
= Math.round(ipx-oW);
技术分享     top    
= Math.round(ipy-oH);
技术分享    }

技术分享
技术分享    
if(++xrun>=NX*NY*SP){
技术分享     xrun
=0;
技术分享     run
=false;
技术分享     
if(dR==-1)Parent.obj.style.zIndex = 0;
技术分享     dR 
= -dR;
技术分享    }

技术分享   }

技术分享  }

技术分享
技术分享  
this.GE1 = function (N1,N2){
技术分享   
with(this){
技术分享    
if(dR==1){
技术分享     px  
= L;
技术分享     py  
= T;
技术分享     dx  
= ((Parent.L + L) - (x * Parent.W)) / SP;
技术分享     dy  
= ((Parent.T + T) - (y * Parent.H)) / SP;
技术分享     pw  
= W;
技术分享     ph  
= H;
技术分享     dw  
= (Parent.W - W) / SP;
技术分享     dh  
= (Parent.H - H) / SP;
技术分享     ipx 
= -L;
技术分享     ipy 
= -T;
技术分享     idx 
= ((x * Parent.W) - L) / SP;
技术分享     idy 
= ((y * Parent.H) - T) / SP;
技术分享    }

技术分享    obj.style.visibility
="visible";
技术分享    
if(img.height>document.body.offsetHeight)oH=(img.height-document.body.offsetHeight)/2else oH = 0;
技术分享    
if(img.width>document.body.offsetWidth/2)oW=(img.width-(document.body.offsetWidth/2))/2else oW = 0;
技术分享    
for(i=0;i<SP;i++) setTimeout("object["+N1+"].object["+N2+"].GE2()",16*i);
技术分享   }

技术分享  }

技术分享
技术分享  
this.DOOT = function (){
技术分享   
with(this){
技术分享    W 
=  Parent.W  / NX;
技术分享    H 
=  Parent.H / NY;
技术分享    L 
=  x * W;
技术分享    T 
=  y * H;
技术分享   }

技术分享  }

技术分享 }

技术分享
技术分享 
var  k = 0;
技术分享 
for(var i=0;i<NY;i++)
技术分享  
for(var j=0;j<NX;j++)
技术分享   
this.object[k++= new CImg(this,i,j);
技术分享
技术分享 
this.GE1  = function (){
技术分享  
with(this){
技术分享   
if(!run){
技术分享    TXTBOX.innerHTML 
= "<div style=‘margin:2%‘>"+TXTSRC[N%nI].innerHTML+"</div>";
技术分享    run 
= true;
技术分享    obj.style.zIndex 
= 1;
技术分享    
for(var i=0;i<NX*NY;i++) setTimeout("object["+N+"].object["+i+"].GE1("+N+","+i+")",i*DELAY);
技术分享   }

技术分享  }

技术分享 }

技术分享
技术分享 
this.DOOT = function (){
技术分享  
with(this){
技术分享   
if(img.width<iW)iW=img.width;
技术分享   
if(img.height<iH)iH=img.height;
技术分享   
with(obj.style){
技术分享    W 
= width  = iW  / NX;
技术分享    H 
= height = iH / NY;
技术分享    L 
= left   = x * W;
技术分享    T 
= top    = y * H;
技术分享   }

技术分享   
with(img.style){
技术分享    width  
= W;
技术分享    height 
= H;
技术分享   }

技术分享   
for(var i in object) object[i].DOOT();
技术分享  }

技术分享 }

技术分享}

技术分享
技术分享
技术分享onload 
= function() {
技术分享 IMGSRC 
= document.getElementById("imgsrc").getElementsByTagName("img");
技术分享 TXTSRC 
= document.getElementById("txtsrc").getElementsByTagName("div");
技术分享 IMGBOX 
= document.getElementById("imgbox");
技术分享 TXTBOX 
= document.getElementById("txtbox");
技术分享 CENTER 
= document.getElementById("center");
技术分享 iH 
= document.body.offsetHeight;
技术分享 iW 
= document.body.offsetWidth/2;
技术分享 nI 
= IMGSRC.length;
技术分享 
var k = 0;
技术分享 
for(var i=0;i<NY;i++){
技术分享  
for(var j=0;j<NX;j++){
技术分享   object[k] 
= new CObj(k,i,j);
技术分享   object[k
++].DOOT();
技术分享  }

技术分享 }

技术分享 IMGBOX.style.width  
= iW;
技术分享 IMGBOX.style.height 
= iH;
技术分享 TXTBOX.style.width  
= iW;
技术分享 TXTBOX.style.height 
= iH;
技术分享 TXTBOX.style.left   
= iW;
技术分享 TXTBOX.style.visibility
="visible";
技术分享 CENTER.style.left   
= -iW;
技术分享 CENTER.style.top    
= -iH/2;
技术分享}

技术分享
//-->
技术分享
</script>
技术分享
</head>
技术分享
技术分享
<body>
技术分享
<div style="position:absolute;left:50%;top:50%;"><div id="center" style="position:absolute;">
技术分享
技术分享 
<div id="imgbox" style="position:absolute;left:0;top:0;overflow:hidden;"></div>
技术分享 
<div id="txtbox" style="position:absolute;visibility:hidden;overflow:hidden;background:#333;color:#FFF;font-family:verdana;font-size:0.8em;">
技术分享  
<div style="margin:2%">
技术分享  
<h2>IMGBOX</h2>Click the thumbnails on the left for a larger image. The description connected to the clicked image is displayed here.<br>
技术分享  
<br>Note: for performance reasons, images are not resized and must be all of the same size.
技术分享  
</div>
技术分享 
</div>
技术分享
技术分享
技术分享
</div></div>
技术分享
技术分享
<div id="imgsrc" style="visibility:hidden">
技术分享 
<img src="http://www.webjx.com/upfiles/20050411/BS9097.jpg">
技术分享 
<img src="http://www.webjx.com/upfiles/20050411/BS9092.jpg">
技术分享 
<img src="http://www.webjx.com/upfiles/20050411/BS9084.jpg">
技术分享 
<img src="http://www.webjx.com/upfiles/20050411/BS9064.jpg">
技术分享 
<img src="http://www.webjx.com/upfiles/20050411/BS9050.jpg">
技术分享 
<img src="http://www.webjx.com/upfiles/20050411/BS9070.jpg">
技术分享 
<img src="http://www.webjx.com/upfiles/20050411/BS9079.jpg">
技术分享 
<img src="http://www.webjx.com/upfiles/20050411/BS9068.jpg">
技术分享 
<img src="http://www.webjx.com/upfiles/20050411/BS9039.jpg">
技术分享
</div>
技术分享
技术分享
<div id="txtsrc" style="visibility:hidden">
技术分享 
<div>
技术分享  
<h2>the river</h2><br>Awaken from my nap by the river
技术分享 
</div>
技术分享 
<div>
技术分享  
<h2>transparency</h2><br>Its transparency was hypnotizing.
技术分享 
</div>
技术分享 
<div>
技术分享  
<h2>cold</h2><br>Currents of cold water played with light.
技术分享 
</div>
技术分享 
<div>
技术分享  
<h2>sank in</h2><br>I threw a few nuts into the river. They floated for a while, then sank in.
技术分享 
</div>
技术分享 
<div>
技术分享  
<h2>masked</h2><br>A wide stepping stone masked the water‘s depth.
技术分享 
</div>
技术分享 
<div>
技术分享  
<h2>a glimpse</h2><br>Later on, I had a glimpse of the river‘s bed.
技术分享 
</div>
技术分享 
<div>
技术分享  
<h2>forgotten</h2><br>The wheelchair made a noise. Again, I had forgotten about my legs.
技术分享 
</div>
技术分享 
<div>
技术分享  
<h2>floated</h2><br>Still, I floated in oblivion of things too real.
技术分享 
</div>
技术分享 
<div>
技术分享  
<h2>for me</h2><br>I stared fixedly at the water‘s open arms. The stream was singing for me.
技术分享 
</div>
技术分享
</div>
技术分享
技术分享
<!-- crossbrowser images_loading_bar - Gerard Ferrandez - www.dhteumeuleu.com - Feb 2005 -->
技术分享
<span id=LB0 style="position:absolute;left:50%;top:50%;"><span style="position:absolute;font-family:arial;font-size:10px;color:#FFFFFF;left:-50;top:-18">Loading...</span>
技术分享
<span style="position:absolute;left:-50;top:-5;font-size:1px;width:100;height:10px;background:#333"><span id=LB1 style="position:absolute;left:0;top:0;font-size:1px;width:0;height:10px;background:#FFFFFF"></span></span></span>
技术分享
<script>m00=document.getElementById("imgsrc").getElementsByTagName("img");m01=m00.length;function images_loading_bar(){m02=0;for(i=0;i<m01;i++)m02+=(m00[i].complete)?1:0;document.getElementById("LB1").style.width=Math.round(m02/m01*100);if(m02==m01)setTimeout("document.getElementById(‘LB0‘).style.display=‘none‘",128); else setTimeout("images_loading_bar()"64);};images_loading_bar();</script>
技术分享
<!-- end of images_loading_bar code -->
技术分享
技术分享
</body>
技术分享
</html>

图片轮显效果大全

标签:

原文地址:http://www.cnblogs.com/mengfanrong/p/4501590.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!