Hi there,
I was wondering if someone can help me with this one. I'm trying to get two animated gifs to change on refresh, unfortunately what I have below is not giving the expected result.
Thank you in advance!
JavaScript
<script type="text/javascript"
>
//<![CDATA[if (document.getElementById) { window.onload = swap }; function swap() {
var numimages=2; rndimg = new
Array("images/panel/greece_129-x-143.gif",
"/images/panel/greece_129-x-143.gif";
x=(Math.floor(Math.random()*numimages)); randomimage=(rndimg[x]);
document.getElementById("eventad").style.backgroun dImage = "url("+
randomimage +")"; }//]]>
</script>
CSS
#eventad {
height:144px; width:129px;
border:0px solid #000;
background:#fff url(/newftbportal/images/panel/athens_129-x-143.
gif) no-repeat center center;
text-indent:-9999px;
}