Right now I have a mouse over event that swaps pictures. I was hoping to add a timer with events so that as long as the mouse is over the image the jpeg continues to be swapped out going through a basic slide show.
Here is what I have so far for my image setup and swap function:
here is the mouseover event call in the htmlCode:<script type="text/javascript"> <!-- function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } } function changeImages() { if (document.images && (preloadFlag == true)) { for (var i=0; i<changeImages.arguments.length; i+=2) { document[changeImages.arguments[i]].src = changeImages.arguments[i+1]; } } } var preloadFlag = false; function preloadImages() { if (document.images) { about_us_over = newImage("http://forum.codecall.net/images/about-us-over.jpg"); services_over = newImage("http://forum.codecall.net/images/services-over.jpg"); products_over = newImage("http://forum.codecall.net/images/products-over.jpg"); contacts_over = newImage("http://forum.codecall.net/images/contacts-over.jpg"); wel2_over = newImage("http://forum.codecall.net/images/wel2-over.jpg"); po2_over = newImage("http://forum.codecall.net/images/po2-over.jpg"); preloadFlag = true; } } </script>
I think I am going to need to set up a flag variable for the status of the mouse (in or out of the image) and when the status is changed to in the image I need a timer to start and at a set interval I need to have another switch image function called. I am pretty new to javascript (C# programmer so it looks farmiliar but I get lost when I try to write from scratch) so if someone doesn't mind helping me out a bit I would appreciate it.HTML Code:<td colspan="2" rowspan="2"> <a href="#" onmouseover="window.status='wel2'; changeImages('wel2', 'images/wel2-over.jpg'); return true;" onmouseout="window.status=''; changeImages('wel2', 'images/wel2.jpg'); return true;" onmousedown="changeImages('wel2', 'images/wel2-over.jpg'); return true;" onmouseup="changeImages('wel2', 'images/wel2-over.jpg'); return true;"> <img name="wel2" src="http://forum.codecall.net/images/wel2.jpg" width="114" height="93" border="0" alt="wel2"></a></td>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks