Greetings,
At present, I have some javascript code and HTML which looks like this (Created mostly using Dreamweaver 3.0):
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}
<td align="right"><b><font face="Arial" size="3"><a href=http://www.webdeveloper.com/forum/archive/index.php/"current.html" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('CurrentImage','','images/NewImage.jpg',1);;return document.MM_returnValue">Current
Image</a></font></b></td>
What happens in this code is, when the mouse touches the link Current Image, the picture will change from CurrentImage to
NewImage. What I am trying to do, and have been unable to figured out how to, is this:
Supposing this year is 2001. When I divide 2001 with the number 3, you get nothing remainder because 2001/3 = 667 and 0
remainder.
Supposing this year is 2002. When I divide 2002 with the number 3, you get 1 remainder because 2002/3 = 667 and 1
remainder.
Supposing this year is 2003. When I divide 2003 with the number 3, you get 2 remainder because 2002/3 = 667 and 2
remainder.
Depending on what is the remaining number, I would like a different image to be swapped.
Hoping someone out there can help resolve this. Thanx in advance for your help.
Best Regards,
Andrew
At present, I have some javascript code and HTML which looks like this (Created mostly using Dreamweaver 3.0):
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}
<td align="right"><b><font face="Arial" size="3"><a href=http://www.webdeveloper.com/forum/archive/index.php/"current.html" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('CurrentImage','','images/NewImage.jpg',1);;return document.MM_returnValue">Current
Image</a></font></b></td>
What happens in this code is, when the mouse touches the link Current Image, the picture will change from CurrentImage to
NewImage. What I am trying to do, and have been unable to figured out how to, is this:
Supposing this year is 2001. When I divide 2001 with the number 3, you get nothing remainder because 2001/3 = 667 and 0
remainder.
Supposing this year is 2002. When I divide 2002 with the number 3, you get 1 remainder because 2002/3 = 667 and 1
remainder.
Supposing this year is 2003. When I divide 2003 with the number 3, you get 2 remainder because 2002/3 = 667 and 2
remainder.
Depending on what is the remaining number, I would like a different image to be swapped.
Hoping someone out there can help resolve this. Thanx in advance for your help.
Best Regards,
Andrew