34、图片魔幻变化 代码4

34、图片魔幻变化  代码4

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>特效</TITLE>

<META http-equiv=Content-Type content="text/html; charset=gb2312">

<STYLE>BODY {

       BORDER-RIGHT: #c13e54 8px ridge; BORDER-TOP: #c13e54 8px ridge; FONT-WEIGHT: bold; FONT-SIZE: 16pt; BORDER-LEFT: #c13e54 8px ridge; COLOR: #60081f; BORDER-BOTTOM: #c13e54 8px ridge; FONT-STYLE: normal; FONT-FAMILY: 36; BACKGROUND-COLOR: #c1ab3e; TEXT-ALIGN: left

}

.textBox {

       BORDER-RIGHT: #c13e54 6px ridge; PADDING-RIGHT: 20px; BORDER-TOP: #c13e54 6px ridge; PADDING-LEFT: 20px; SCROLLBAR-FACE-COLOR: #c88398; FONT-WEIGHT: bold; FONT-SIZE: 16pt; Z-INDEX: 2; FILTER: alpha (opacity=100, finishopacity=100, style=1); LEFT: 15%; VISIBILITY: hidden; PADDING-BOTTOM: 10px; OVERFLOW: auto; BORDER-LEFT: #c13e54 6px ridge; WIDTH: 70%; COLOR: #60081f; SCROLLBAR-ARROW-COLOR: #000000; PADDING-TOP: 10px; SCROLLBAR-TRACK-COLOR: #f3cdd3; BORDER-BOTTOM: #c13e5e 6px ridge; FONT-STYLE: normal; FONT-FAMILY: "36"; SCROLLBAR-BASE-COLOR: #f3cdd3; POSITION: absolute; TOP: 20%; HEIGHT: 70%; BACKGROUND-COLOR: #fff8dc

}

.openButton {

       BORDER-RIGHT: #c13e54 2px ridge; BORDER-TOP: #c13e54 2px ridge; FONT-WEIGHT: bold; FONT-SIZE: 20pt; BACKGROUND: none transparent scroll repeat 0% 0%; LEFT: 45%; BORDER-LEFT: #c13e54 2px ridge; WIDTH: 80px; CURSOR: hand; COLOR: #60081f; BORDER-BOTTOM: #c13e54 2px ridge; FONT-STYLE: normal; FONT-FAMILY: "agatha"; POSITION: absolute; TOP: 20px; HEIGHT: 30px

}

</STYLE>

 

<META content="MSHTML 6.00.2900.2144" name=GENERATOR></HEAD>

<BODY

style="FILTER: progid:DXImageTransform.Microsoft.Gradient(startColorstr=#800000,endColorstr=#000000,gradientType=0.5,enabled=0)"

bgColor=#c1abe3 background=sto04/back7.jpg scroll=no><IMG id=bkg1

style="LEFT: -1800px; POSITION: absolute; TOP: -1800px"

src="sto04/back4.jpg"> <IMG id=bkg2

style="LEFT: -1800px; POSITION: absolute; TOP: -1800px"

src="sto04/back3.jpg"> <IMG id=bkg3

style="LEFT: -1800px; POSITION: absolute; TOP: -1800px"

src="sto04/back6.jpg"> <BGSOUND balance=0 src="" volume=0 loop=infinite>

<DIV class=textbox id=origTextbox>

<DIV>怀揣一段往昔的心事

<P>    在你我曾经相爱的地方

<P>寻找往日的记忆

<P>    再收集七彩的阳光

<P>编制成记忆的梦想

<P>

<P>

<P>

<P>

<P>

<P>

<P>

<P></P></DIV></DIV><BUTTON language=VBScript class=openButton id=openBtn

onclick=popOpen()>进入</BUTTON>

<DIV id=src style="DISPLAY: none">

<STYLE id=PopupStyle>.popButtons {

       BORDER-RIGHT: #c13e54 2px ridge; BORDER-TOP: #c13e54 2px ridge; FONT-WEIGHT: bold; FONT-SIZE: 10pt; BACKGROUND: none transparent scroll repeat 0% 0%; BORDER-LEFT: #c13e54 2px ridge; WIDTH: 80px; CURSOR: hand; COLOR: #5b4500; BORDER-BOTTOM: #c13e54 2px ridge; FONT-FAMILY: Agatha; POSITION: absolute; TOP: 20px; HEIGHT: 30px

}

.pictures {

       Z-INDEX: 1; FILTER: revealTrans; LEFT: -1800px; VISIBILITY: hidden; POSITION: absolute; TOP: -1800px

}

.caption {

       FONT-WEIGHT: bold; FONT-SIZE: 18pt; VISIBILITY: hidden; COLOR: #60081f; FONT-STYLE: normal; FONT-FAMILY: "36"; POSITION: absolute; HEIGHT: 30px; TEXT-ALIGN: center

}

.playerStatus {

       FONT-WEIGHT: bold; FONT-SIZE: 10pt; RIGHT: 25px; VISIBILITY: hidden; WIDTH: 60px; COLOR: #60081f; FONT-STYLE: italic; FONT-FAMILY: AGATHA; POSITION: absolute; TOP: 55px; HEIGHT: 30px; TEXT-ALIGN: center

}

</STYLE>

<BUTTON language=VBScript id=nofocusBtn

style="LEFT: -1000px; POSITION: absolute; TOP: -1000px"></BUTTON><BUTTON

language=VBScript class=popButtons id=closeBtn style="LEFT: 20px"

onclick=parent.Popup.hide()>退出</BUTTON><BUTTON language=VBScript

class=popButtons id=playBtn style="RIGHT: 20px"

onclick=parent.playPictures()>开始</BUTTON>

<DIV class=playerStatus id=status1>点击</DIV>

<DIV class=playerStatus id=status2>点击</DIV><IMG class=pictures id=pic1

style="LEFT: -1800px; WIDTH: 256px; POSITION: absolute; TOP: -1800px; HEIGHT: 384px"

src="sto04/1.gif"> <IMG class=pictures id=pic2 src="sto04/2.gif">

<IMG class=pictures id=pic3 src="sto04/3.gif"> <IMG class=pictures

id=pic4 src="sto04/4.gif"> <IMG class=pictures id=pic5

src="sto04/5.gif"> <IMG class=pictures id=pic6 src="sto04/6.gif">

<DIV class=caption id=cap1>猫咪1</DIV>

<DIV class=caption id=cap2>猫咪2</DIV>

<DIV class=caption id=cap3>猫咪3</DIV>

<DIV class=caption id=cap4>猫咪4</DIV>

<DIV class=caption id=cap5>猫咪5</DIV>

<DIV class=caption id=cap6>猫咪6</DIV></DIV>

<SCRIPT language=VBScript>

'==============================

' Thumbnail Slide Show script version 1.15

' written by Richard Eagle 08/03/01

' last revised 08/06/01

'==============================

' VBPop part -  Donald Anadell

'==============================

Set Popup=window.createPopup()

Set PopupBody=Popup.document.body

PopupBody.style.cursor="default"

PopupBody.style.backgroundColor="#C1AB3E"

PopupBody.style.border="8px ridge #C13E54"

PopupBody.style.color="#C1AB3E"

PopupBody.background=bkg2.src // Use bkg1.src, bkg2.src, bkg3.src, etc.

Set PA=PopupBody.all

PopupBody.innerHTML="<div style='display:none'>"+PopupStyle.innerHTML+"</div>"+src.innerHTML

 

sub popOpen()

       Popup.show (window.parent.screen.width-popW)/2,(window.parent.screen.height-popH)/2, popW, popH

       resetIt

end sub

 

'==============================

 

'==============================

dim popH, popW, popBorderW, numPics, picBorderW, picBorderColor

dim tnailW, tnailH, tnailGap, tnailBorderW, tnailBorderColor, tnailBorderState

dim prevPic, currPic, nextPic, picturePlayTime, playStatus, myTimer, origBorderW

dim picTopGap, btnTopGap, btnSideGap, statusTopGap, capTopGap, capH, capExtraW

dim tnailBottomGap, tnailSideGap, tnailShiftDown, tranTypes, tranTypeStr

dim openBtnW, openBtnH, popBtnW, popBtnH, aveLandPopBtns, cntrPortPopBtns

dim textboxVertGap, textboxSideGap, textBoxBkgTile, openBtnBkgTile, popUpBkgTile, popBtnsBkgTile

 

<!---THIS IS WHERE YOU MAKE CHANGES FOR STYLE, ETC.--->

REM *** USER VARIABLES - change as needed

displayMode="P"          // display thumbnails along the bottom "L" (Landscape) or half on each side "P" (Portrait)

FullScreen="YA"          // pop up full screen "Y" or "N" or "YA" (YA averages picture and thumbnail locations - FS pop up only)

origBorderW=8             // width of border in original window - make sure it matches

popW=640: popH=480  // pop up width & height - FullScreen="Y" or "YA"overrides these ("YA" is prefered to "Y")

popBorderW=8             // pop up border width - make sure it matches

numPics=6            // number of pictures - make this equal to the number of pictures used

picBorderW=4              // picture border width

picBorderColor="#c13e5e"    // picture border color

tnailW=76             // thumbnail width  Note: width to height ratio of thumbnails should be about same as picture

tnailH=98                     // thumbnail height

tnailGap=12           // gap between thumbnails (default 10)

tnailBorderW=2            // thumbnail border width (default 2)

tnailBorderColor="#c13e5e"  // thumbnail border color

picturePlayTime=10             // display time for each picture in seconds (default 10)

picTopGap=20              // gap between top border & top of picture (default 20)

btnTopGap=20              // gap between top of buttons & top border (default 20)

btnSideGap=20             // gap between side of buttons & side border (default 20)

statusTopGap=10           // gap between play button & player status text (default 10)

capTopGap=10              // gap between top of caption & bottom of picture (default 10)

capH=30               // caption div height (default 30)

playStatTopGap=10              // gap between top of player status & bottom of play button (default 10)

capExtraW=100            // makes caption wider than picture by this many pixels (default 100)

tnailBottomGap=20              // gap between bottom border & bottom of thumbnails if displayMode="L" (default 20)

tnailSideGap=30           // gap between side border & side of thumbnails if displayMode="P" (default 30)

tnailShiftDown=0          // shifts thumbnails down if displayMode="P" (default 0)

tranTypes=1           // transition types - use 0, 1, 2, 3 (default 1)

openBtnW=240             // open button width - variable used for centering open button (default 80)

openBtnH=45        // open button height (default 30)

popBtnW=80         // pop button width (default 80)

popBtnH=30          // pop button width (default 30)

aveLandPopBtns="YT"  // averages location of buttons in pop up "N", "YT" or "YM" (YT - horiz, YM - horiz & vert)

                     // popBtnAverage only works in Full Screen pop up - YM for Landscape mode only

                     // "YT" overrides btnTopGap, "YM" overrides btnTopGap & btnSideGap

cntrPortPopBtns="Y"    // "Y" or "N" (default "N" - Ignored in Landscape mode) centers buttons in pop up above thumbnails

                     // only in Full Screen pop up. Does not override btnTopGap

textboxVertGap=15        // gap above & below textbox and open button (default 20)

textboxSideGap=.15      // gap between border & text box (default .15 which makes it 15% of window width)

// Optional tiled background images for textbox, open button and buttons in pop up

// Make sure to disable any BGTx's not being used - example:    // BGT3="URL(" & bkg3.src & ")"

BGT1="URL(" & bkg1.src & ")"

BGT2="URL(" & bkg2.src & ")"

BGT3="URL(" & bkg3.src & ")"

textBoxBkgTile=BGT3  // (default BGT2)

openBtnBkgTile=BGT1  // (default BGT2)

popBtnsBkgTile=BGT1  // (default BGT1)

// END OF USER VARIABLES

 

REM Initial picture/layer setup - DO NOT CHANGE!!!

prevPic=numPics: currPic=1: nextPic=2

 

if FullScreen<>"N" then

       popW=window.parent.screen.width

       popH=window.parent.screen.height

end if

 

select case tranTypes

       case 1: tranTypeStr="00010203080910111314151617181920"    // all except fade in & thin H/V blinds

       case 2: tranTypeStr="0001020308091011"                 // same as 1 except no diagonals

       case 3: tranTypeStr="0002"                               // rectangle & circle outside to inside only

end select

 

sub resetIt()

       prevPic=numPics: currPic=1: nextPic=2

       playStatus="on": PA.status1.style.visibility="visible": PA.status2.style.visibility="hidden"

       pic1.style.zindex=2

       for j=1 to numPics

              if j=1 then

                     PA("pic"&j).style.visibility="visible"

                     PA("cap"+cstr(j)).style.visibility="visible"

              else

                     PA("pic"&j).style.visibility="hidden"

                     PA("cap"+cstr(j)).style.visibility="hidden"

              end if

       next

       clearTimeout(myTimer)

       myTimer=SetTimeOut("pictureTransition", picturePlayTime*100,"VBScript")

end sub

 

sub window_onLoad()

       on error resume next

       REM Set up dimensions, location, etc. for pictures and thumbnails

       pW=pic1.style.posWidth

       pH=pic1.style.posHeight

       picLeft=(popW-(pW+(2*(popBorderW+picBorderW))))/2

       pBoxW=pW+(2*picBorderW)

       pBoxH=pH+(2*picBorderW)

       tBoxW=tnailW+(2*tnailBorderW)

       tBoxH=tnailH+(2*tnailBorderW)

       REM Setup picture & thumbnail locations

       tempBorder=cstr(picBorderW)+"px ridge "+picBorderColor

       if displayMode="L" then  'landscape mode

              tDivW=((tBoxW+tnailGap)*numPics)-tnailGap

              tnailEndGap=((popW-(2*popBorderW))-(tDivW))/2

              TL=tnailEndGap

              if FullScreen="YA" then

                     AveGap=(popH-(pBoxH+tBoxH+capTopGap+capH+(2*popBorderW)))/3

                     picTopGap=AveGap

                     tnailBottomGap=AveGap

              end if

              for j=1 to numPics

                     PA("pic"&j).style.top=picTopGap

                     PA("pic"&j).style.left=picLeft

                     PA("pic"&j).style.border=tempBorder

                     if j=1 then PA("pic"&j).style.visibility="visible" else PA("pic"&j).style.visibility="hidden"

                     data="<DIV id=t"&j&" style='Z-INDEX: 2; POSITION: absolute; BOTTOM: "&tnailBottomGap&"px; "

                     data=data&"LEFT: "&TL&"px;  WIDTH: "&tBoxW&"px;HEIGHT: "&tBoxH&"px; CURSOR: hand; "

                     data=data&"BORDER: "&tnailBorderW&"px ridge "&tnailBorderColor&"' onclick=parent.pickTnail("&j&") "

                     data=data&"onMouseOver=parent.changeTnailBorder("&j&") onMouseOut=parent.changeTnailBorder("&j&")>"

                     data=data&"<IMG src='"&PA("pic"+cstr(j)).src&"' WIDTH="&tnailW&" HEIGHT="&tnailH&"></DIV>"

                     PopupBody.insertAdjacentHTML "afterBegin", data

                     TL=TL+(tBoxW+tnailGap)

              next

       else  'portrait mode

              if numPics mod 2 = 1 then

                     npls=(numPics+1)/2: nprs=npls-1

              else

                     npls=numPics/2: nprs=npls

              end if

              tnailTop=((popH-((tBoxH*npls)+(tnailGap*(npls-1))))/2)+tnailShiftDown

              if FullScreen="YA" then

                     AveGap=(popH-(pBoxH+capTopGap+capH+(2*popBorderW)))/2

                     picTopGap=AveGap

                     tnailSideGap=(popW-(pBoxW+(2*(tBoxW+popBorderW))))/4

              end if

              for j=1 to numPics

                     PA("pic"&j).style.top=picTopGap

                     PA("pic"&j).style.left=picLeft

                     PA("pic"&j).style.border=tempBorder

                     if j=1 then PA("pic"&j).style.visibility="visible" else PA("pic"&j).style.visibility="hidden"

                     if j <= npls then

                            TnS="LEFT: "+cstr(tnailSideGap)

                            TnT=(tnailTop+(((j-1)*(tBoxH+tnailGap))))-popBorderW

                     else

                            TnS="RIGHT: "+cstr(tnailSideGap)

                            if numPics mod 2 = 0 then

                                   TnT=(tnailTop+((((j-1)-npls)*(tBoxH+tnailGap))))-popBorderW

                            else

                                   TnT=((tnailTop+((((j-1)-npls)*(tBoxH+tnailGap))))-popBorderW)+((tBoxH+tnailGap)/2)

                            end if

                     end if

                     data="<DIV id=t"&j&" style='Z-INDEX: 2; POSITION: absolute; TOP: "&TnT&"px; "&TnS&"px;  "

                     data=data&"WIDTH: "&tBoxW&"px;HEIGHT: "&tBoxH&"px; CURSOR: hand; "

                     data=data&"BORDER: "&tnailBorderW&"px ridge "&tnailBorderColor&"' onclick=parent.pickTnail("&j&") "

                     data=data&"onMouseOver=parent.changeTnailBorder("&j&") onMouseOut=parent.changeTnailBorder("&j&")>"

                     data=data&"<IMG src='"&PA("pic"+cstr(j)).src&"' WIDTH="&tnailW&" HEIGHT="&tnailH&"></DIV>"

                     PopupBody.insertAdjacentHTML "afterBegin", data

                     TL=TL+(tBoxW+tnailGap)

              next

       end if

       REM Locate captions and show caption for first picture

       for j=1 to numPics

              PA("cap"+cstr(j)).style.top=picTopGap+pBoxH+capTopGap

              PA("cap"+cstr(j)).style.left=picLeft-(capExtraW/2)

              PA("cap"+cstr(j)).style.width=pBoxW+capExtraW

       next

       PA.cap1.style.visibility="visible"

       REM Locate close & play buttons and player status text

       if aveLandPopBtns<>"N" and displayMode="L" and FullScreen<>"N" then

              btnSideGap=(popW-(pBoxW+(2*(popBtnW+popBorderW))))/4

              if aveLandPopBtns="YM" then

                     btnTopGap=picTopGap+((pBoxH-popBtnH)/2)

              elseif aveLandPopBtns="YT" then

                     btnTopGap=picTopGap

              end if

       end if

       if cntrPortPopBtns="Y" and displayMode="P" and FullScreen<>"N" then

              btnSideGap=(popW-(pBoxW+(2*(popBtnW+popBorderW))))/4

       end if

       PA.closeBtn.style.top=btnTopGap

       PA.closeBtn.style.left=btnSideGap

       PA.playBtn.style.top=btnTopGap

       PA.playBtn.style.right=btnSideGap

       PA.status1.style.top=btnTopGap+popBtnH+statusTopGap

       PA.status1.style.right=btnSideGap

       PA.status1.style.width=popBtnW

       PA.status2.style.top=btnTopGap+popBtnH+statusTopGap

       PA.status2.style.right=btnSideGap

       PA.status2.style.width=popBtnW

       REM Position & size textbox, open button

       fitOrigTextboxEtc

end sub

 

sub window_onResize()

       fitOrigTextboxEtc

end sub

 

sub fitOrigTextboxEtc()

       REM Move open button and textbox in original window

       openBtn.style.top=textboxVertGap

       openBtn.style.width=openBtnW

       openBtn.style.height=openBtnH

       openBtn.style.left=(document.body.clientWidth-openBtnW)/2

       openBtn.style.backgroundImage=openBtnBkgTile

       origTextbox.style.top=openBtnH+(2*textboxVertGap)

       origTextbox.style.left=(document.body.clientWidth*textboxSideGap)

       origTextbox.style.height=document.body.clientHeight-(openBtnH+(3*textboxVertGap))

       xGap=int((document.body.clientWidth*textboxSideGap)+.4999)

       origTextbox.style.left=xGap

       origTextbox.style.width=document.body.clientWidth-(2*xGap)

       origTextbox.style.backgroundImage=textBoxBkgTile

       origTextbox.style.backgroundattachment="fixed"

       origTextbox.style.visibility="visible"

       REM Add background image to buttons in pop up

       PA.closeBtn.style.backgroundImage=popBtnsBkgTile

       PA.closeBtn.style.width=popBtnW

       PA.closeBtn.style.height=popBtnH

       PA.playBtn.style.backgroundImage=popBtnsBkgTile

       PA.playBtn.style.width=popBtnW

       PA.playBtn.style.height=popBtnH

       loadMsg.style.visibility="hidden"

end sub

 

sub changeTnailBorder(whichPic)

       if tnailBorderState=1 then

              tempBorder=cstr(tnailBorderW)+"px ridge "+tnailBorderColor

              PA("t"+cstr(whichPic)).style.border=tempBorder

       else

              tempBorder=cstr(tnailBorderW+2)+"px ridge "+tnailBorderColor

              PA("t"+cstr(whichPic)).style.border=tempBorder

       end if

       if tnailBorderState=1 then tnailBorderState=0 else tnailBorderState=1

end sub

 

sub pictureTransition()

       clearTimeout(myTimer)

       if tranTypes>=1 then

              TT=mid(tranTypeStr,((int(rnd*(len(tranTypeStr)/2)))*2)+1,2)

              if left(TT,1)="0" then TT=right(TT,1)

       else

              TT=23

       end  if

       PA("pic"&prevPic).style.visibility="hidden"

       PA("pic"&prevPic).style.zindex=1

       PA("pic"&currPic).style.visibility="visible"

       PA("pic"&currPic).style.zindex=2

       PA("pic"&nextPic).style.zindex=3

       PA("pic"&nextPic).filters(0).Apply()

       PA("pic"&nextPic).filters(0).transition=TT

       PA("pic"&nextPic).style.visibility="visible"

       PA("pic"&nextPic).filters(0).Play(1.50)

       prevPic=currPic

       currPic=nextPic

       nextPic=nextPic+1: if nextPic>numPics then nextPic=1

       changeCaption(currPic)

       if playStatus="on" then

              myTimer=SetTimeOut("pictureTransition", picturePlayTime*500,"VBScript")

       end if

end sub

 

sub playPictures()

       if playStatus="off" then

              playStatus="on"

              PA.status1.style.visibility="visible": PA.status2.style.visibility="hidden"

              pictureTransition

       else

              'do nothing - already playing

       end if

end sub

 

sub pickTnail(whichPic)

       playStatus="off"

       PA.status1.style.visibility="hidden": PA.status2.style.visibility="visible"

       nextPic=whichPic

       pictureTransition

end sub

 

sub changeCaption(whichPic)

       for j=1 to numPics

              if j=whichPic then

                     PA("cap"+cstr(j)).style.visibility="visible"

              else

                     PA("cap"+cstr(j)).style.visibility="hidden"

              end if

       next

end sub

 

</SCRIPT>

</BODY></HTML>

 

Write a comment

Comments: 0