Click to See Complete Forum and Search --> : Need help w/ blinking background


Lolli
12-06-2003, 11:09 AM
Hi ya'll,
In the Script Archive, at http://www.bravenet.comunder Backgrounds,there is a script for a blinking background.It allows a background color to blink a determined amount of times after clicking a button.
What I'm wondering is if there's a way to make a background IMAGE blink?
Also wondering if there's a way to start this function with mouseover,instead of having to click a button?
I would like to use two image files,(kind of like a imageflip)If that is possible,could you also use more than two images,with the end result being like a super-hyper slideshow?
Thanx in advance!
\m/ Lolli
P.S. I don't plan on using a image background that covers the entire page,just a smaller image background inside a table.I also would like to use a popup box warning epileptics about the possibility of reactions prior to the blink function start.

TheBearMay
12-06-2003, 02:53 PM
Since you don't want one large image or multiple repeats of a smaller image the easiest way is probably to use multiple DIVs. You also won't need a table to position the image this way just set your top, left, width, and height appropriately.


<script>
var ImageListDir='file:///D:/My Documents/My Pictures/';
var ImageListArr=['Beach Island.jpg','Blazing Sun.jpg',
'Mountain Side.jpg',...];
var ImageListMaxItems = ImageListArr.length - 1;
var ImageListInx=0;
var imageTimer;

function BgChanger(){
ScreenImg.src=ImageListDir+ImageListArr[ImageListInx];
ImageListInx++;
if (ImageListInx > ImageListMaxItems) ImageListInx=0;
imageTimer=setTimeout('BgChanger()',3000);
}
</script>
</head>
<body>

<div>
<img id='ScreenImg'
style="position: absolute; left:100; top:100; width: 320; height: 100;"
onmouseover="alert('BG Change Commencing');BgChanger();"
onmouseout="clearTimeout(imageTimer);">
</div>

<div>
Other Content here....