HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Change Image on Every Web Visit
Post new topic   Reply to topic    HTML Help Forum Index -> General HTML
View previous topic :: View next topic  
Author Message
grazzt



Joined: 08 Nov 2005
Posts: 9

PostPosted: Tue Dec 06, 2005 8:48 pm     Change Image on Every Web Visit Reply with quote

I have a bunch of banner advertisements on my site and would like to clean it up. I would like to show 2 of the ads at a time and rotate the image everytime some refreshes or visits my home page. Any suggestions? I found a javascript to change images ona time interval but not the page loads.

grazzt
ScottyO.net
nagasree



Joined: 21 Sep 2004
Posts: 82
Location: Hyderabad, India

PostPosted: Wed Dec 07, 2005 1:22 am     Reply with quote

You can accomplish using little javascript (random funtion)

Try this out, it may give u a clue

Code:

<HTML>
<HEAD>
<TITLE>New Document</TITLE>
</HEAD>
<BODY>
<img src="images/Banner1.jpg" id=imgBanner border=0>
</BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
   var imgArray = new Array(3);
   imgArray[0] = "images/Banner1.jpg";
   imgArray[1] = "images/Banner2.jpg";
   imgArray[2] = "images/Banner3.jpg";
   var randomMax = imgArray.length - 1;
   document.getElementById('imgBanner').src =  imgArray[Math.round(Math.random()*randomMax)];
//-->
</SCRIPT>
</HTML>



-Nagasree
grazzt



Joined: 08 Nov 2005
Posts: 9

PostPosted: Wed Dec 07, 2005 3:10 pm     Rotating more than an Image Reply with quote

I think I need to be a little more specific. I have a bit more information then just the image. I need it linked also. Each line of code is what I would like to be rotated. Here is the code I would like to rotate:

Code:

<script type="text/javascript" language='javascript 1.2' src="http://www.ultimatebet.com/affiliates/getlinkcode_js.php?lt=halftile&id=1183"></script>

<a href="http://www.partypoker.com/Downloads/2654797"><img src="pics/pp100extra_120x60_1.gif"></a>

<a href="http://www.empirepoker.com/Downloads/2583040/EmpirePokerSetup.exe"><img src="pics/TN_120X60_OTH_02332_blueglowmiddle_EPK.gif"></a>

<a href="http://www.1and1.com/?k_id=9661297" target="_blank"><img src="http://1and1.org/banners/1and1_120x60_D1.gif" width="120" height="60"  border="0"/></a>

<a href="http://www.SellShareware.com/ProgramInfo.asp?AfID=26097&PrID=66156"><img src="pics/pt_banner_v.gif"></a>

<a href="http://www.phpjunkyard.com"><img src="http://www.phpjunkyard.com/ban/120x90.gif" height="90" width="120" border="0" alt="Free PHP scripts for download"></a>

<a href="http://www.dynamicdrive.com"><img src="pics/ddsmall.gif"></a>


How about a PHP script?
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Wed Dec 07, 2005 6:01 pm     Reply with quote

Check out PHP ads
zylstra
Site Admin


Joined: 10 May 2004
Posts: 130

PostPosted: Thu Dec 08, 2005 12:18 am     Reply with quote

You're probably looking for a Javascript though, right? Try http://www.brettb.com/js_banner_ad_rotator.asp for one that rotates the ads even after the page is loaded. Or better yet, here is a web page that creates your particular script for you: http://www.devdude.com/tools/tool.cgi?id=t1 .
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> General HTML All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial