' Script by Bill Scott, December, 1999

' billscott@redrivernet.com

' Notes:

' To expand an image call subroutine:

'       expandSetup4

' To contract an existing image call subroutine:

'       contractSetup4

'       Be sure to remove display:none from the HTML image tag below.

' Set xpercent and ypercent in Window_Onload below to desired percentage size of the original image, i.e., 50=half size.

' Neither xpercent or ypercent have to be equal in value.

' You may reposition the image in the HTML image tag below. TOP=number of pixels from top of screen. LEFT=number of pixels from left side of screen.

' Set the actual width and height of image in the HTML image tag below.

 

Option Explicit

 

Dim myTimer2

Dim gw, gh, gcount

Dim gpl, gpt, gpr, gpb, gpxstart, gpystart, gxycount, ginc, gxyinc

Dim xpercent, ypercent, xtemp, ytemp

Dim origw, origh, origl, origt

 

Sub Window_OnLoad()

xpercent=100

ypercent=100

myTimer2=SetTimeOut("expandSetup4",2000)

End Sub

 

' This script expands a graphic image (image id=graphic1) from a zero point to any specified size. Image emanates from its top-left corner as a thin horizontal bar, then sweeps vertically.

Sub expandSetup4()

' Set desired X,Y graphic size compared to original**********

origw=graphic1.style.posWidth

origh=graphic1.style.posHeight

ClearTimeOut(myTimer2)

' Expand setup**********

xpercent=xpercent*.01

ypercent=ypercent*.01

' Get image width and height.

gw=CInt(xpercent*graphic1.style.posWidth)

gh=CInt(ypercent*graphic1.style.posHeight)

 

' Set expansion factor.

gcount=.04

ginc=gcount

 

' Reduce image size to zero, then display.

graphic1.style.posWidth=0

graphic1.style.posHeight=8

graphic1.style.display=""

 

expandgraphich4

End Sub

 

Sub expandgraphich4()

ClearTimeOut(myTimer2)

graphic1.style.posWidth=CInt(gcount*gw)

if gcount<1.0 then

gcount=gcount+ginc

myTimer2=SetTimeOut("expandgraphich4",10)

else

gcount=.04

myTimer2=SetTimeOut("expandgraphicv4",200)

end if

End Sub

 

Sub expandgraphicv4()

ClearTimeOut(myTimer2)

graphic1.style.posHeight=CInt(gcount*gh)

if gcount<1.0 then

gcount=gcount+ginc

myTimer2=SetTimeOut("expandgraphicv4",50)

end if

End Sub

 

Sub contractSetup4()

ClearTimeOut(myTimer2)

' Contract setup**********

' Get image width and height.

gw=graphic1.style.posWidth

gh=graphic1.style.posHeight

 

' Set contraction factor.

gcount=.96

gxyinc=.04

 

contractgraphicv4

End Sub

 

Sub contractgraphicv4()

ClearTimeOut(myTimer2)

graphic1.style.posHeight=CInt(gcount*gh)

if gcount>gxyinc OR graphic1.style.posHeight>8 then

gcount=gcount-gxyinc

myTimer2=SetTimeOut("contractgraphicv4",50)

else

graphic1.style.posHeight=8

gcount=.96

myTimer2=SetTimeOut("contractgraphich4",200)

end if

End Sub

 

Sub contractgraphich4()

ClearTimeOut(myTimer2)

graphic1.style.posWidth=CInt(gcount*gw)

if gcount<gxyinc then

graphic1.style.display="none"

graphic1.style.posWidth=origw

graphic1.style.posHeight=origh

else

gcount=gcount-gxyinc

myTimer2=SetTimeOut("contractgraphich4",10)

end if

End Sub

