shanuragu
07-25-2003, 12:54 AM
Hi
Is it possible to display banner on a web page using js. Either link the script or in the same page. Is it possible to change banner images with the above condition???
Please help
shara
arturion
08-22-2003, 07:45 PM
I'll give you a script which displays a banner depending on the hour the user enters to your page. You could change it using "onmouseover" or something
<HEAD>
<script languaje="javascript">
<!--
urls = new Array('www.page1.com',www.page2.com','www.page3.com'),
pictures = new Array('picture1.gif','picture2.gif','picture3.gif');
counter=0;
function seek_day(){
today = new Date();
this_day = today.getHours();
if (this_day<=0 && day<7){
counter=0;
} //end if
if (this_day<=8 && day<15){
counter=1;
} //end if
if (this_day<=16 && day<23){
counter=0;
} //end if
} //end function
-->
</script>
<body onload="seek_day();">
<a href=urls[counter]><img src=pictures[counter]></a>
</body>
With this script, the user sees a different link and a different banner, depending of the hour.