| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| First Time Poster! Join Date: Nov 2003
Posts: 1
![]() | help I am designing this web site, it is more like an information web site but on this site there will be advertisements where they will change on there own. So i will have 1 advertisement in a specific space and it will change to another advertisment every ten seconds, how do I write this code for 3 advertisement. Can it be done in html?? Does anyone know any resources I can use for help. Thank you j9hagop@yahoo.com |
| |
| | #2 (permalink) |
| NamePros Member Join Date: Aug 2003 Location: Ontario, Canada
Posts: 98
![]() | You can use Javascript. Put this in your <HEAD> tag: <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- var timeout_1; var adnumber; var imagenum; adnumber = 0; imagenum = 3; function changead(url) { window.document.myimagead.src = url; timeout_1 = setTimeout("changecom",10000); } function changecom() { adnumber = adnumber + 1; if (adnumber == 4) { adnumber = 1; } changead("adimages/" + adnumber + ".bmp"); } ????: NamePros.com http://www.namepros.com/programming/15605-help.html changecom(); //--> </SCRIPT> Change the text in bold into the extension of your files. In the image tag that holds your ad, put in this value: NAME="myimagead" Put all of your images in %webpage_directory%/adimages/ Name the first image 1.*** Name the second one 2.*** Name the third one 3.*** I have not tested this code, wrote it up in a few minutes. So if anyone finds any bugs, please tell me. P.S. You might also want to add preloading.
__________________ Yeah... I knew that. What? |
| |