|
| |
|
|
cooper
Posts: 773 From: Woburn MA USA Status: offline
|
Banner Ad Script - 4/21/2003 10:31:57
I am looking for a banner ad script. I don' t need to track click throughs or impressions, I just need to randomly disply one of 10 to 12 ad banners in my header. The pages are both HTML and ASP. I do not want to switch the HTML pages to ASP pages so the script can' t be ASP based. Any suggestions?
_____________________________
Cooper BAC Web Design - Tools & Templates - Buck A Ball - Stopspamstop.com
|
|
|
|
mbmunday
Posts: 162 Joined: 8/8/2002 From: North Richland Hills, Texas Status: offline
|
RE: Banner Ad Script - 4/24/2003 2:21:30
Try this.......this is a JavaScript one that simply rotates pictures based on milliseconds. Just replace the number of seconds with whatever you find appropriate. You can keep your .html extensions with this one. <script language=" javascript" >
/*
Random image slideshow- By Tyler Clarke (tyler@ihatecoffee.com)
For this script and more, visit http://www.javascriptkit.com
*/
var delay=10000 //set delay in miliseconds
var curindex=0
var randomimages=new Array()
randomimages[0]=" images/banner1.jpg"
randomimages[1]=" images/banner2.jpg"
randomimages[2]=" images/banner3.jpg"
randomimages[3]=" images/banner4.jpg"
randomimages[4]=" images/banner5.jpg"
randomimages[5]=" images/banner6.jpg"
randomimages[6]=" images/banner7.jpg"
randomimages[7]=" images/banner8.jpg"
randomimages[8]=" images/banner9.jpg"
var preload=new Array()
for (n=0;n<randomimages.length;n++)
{
preload[n]=new Image()
preload[n].src=randomimages[n]
}
document.write(' <img name=" defaultimage" src=" ' +randomimages[Math.floor(Math.random()*(randomimages.length))]+' " >' )
function rotateimage()
{
if (curindex==(tempindex=Math.floor(Math.random()*(randomimages.length)))){
curindex=curindex==0? 1 : curindex-1
}
else
curindex=tempindex
document.images.defaultimage.src=randomimages[curindex]
}
setInterval(" rotateimage()" ,delay)
</script> Good luck, MB
|
|
|
|
mbmunday
Posts: 162 Joined: 8/8/2002 From: North Richland Hills, Texas Status: offline
|
RE: Banner Ad Script - 4/24/2003 2:23:07
Awww.....I just realized that this one is just a basic one for images, without links. I' m not that great at JavaScript so I don' t know if you could modify it to add a link to each picture. MB
|
|
|
|
Nancy
Posts: 3626 Joined: 11/9/1999 From: Nebraska Status: offline
|
RE: Banner Ad Script - 4/24/2003 3:00:31
I' ve used this one before: http://www.javascriptcity.com/scripts/local/simage2.htm You can have more than the five shown in the example. I used about 20. Just be sure you change the total number in the script from 5 to however many you want - two places, one place for images, and one for the URL' s. I set it up as an include page so it could easily appear on all pages. Nancy
_____________________________
Easy Estimates -- is a simple to use tool to quickly build a Web site page enabling visitors to quickly and easily create an estimate of the cost of services that you provide.
|
|
|
|
cooper
Posts: 773 From: Woburn MA USA Status: offline
|
RE: Banner Ad Script - 4/28/2003 13:42:50
OK... I decided to use Nancy' s recommended scripts. However, I want to place this script in an " includes" page (the header). Do I need to put the script information in the " head" section of every page on my site?
_____________________________
Cooper BAC Web Design - Tools & Templates - Buck A Ball - Stopspamstop.com
|
|
|
|
Nancy
Posts: 3626 Joined: 11/9/1999 From: Nebraska Status: offline
|
RE: Banner Ad Script - 4/28/2003 16:34:00
You should be able to put everything in the body of the include page and it will work on all pages where you include it. Nancy
_____________________________
Easy Estimates -- is a simple to use tool to quickly build a Web site page enabling visitors to quickly and easily create an estimate of the cost of services that you provide.
|
|
|
|
cooper
Posts: 773 From: Woburn MA USA Status: offline
|
RE: Banner Ad Script - 4/28/2003 16:57:24
I get a runtime error on line 28. I built this on its own page and it worked fine. The I attempted to place the code in my " includes/header.htm" page and started to get the error. Suggestions?
_____________________________
Cooper BAC Web Design - Tools & Templates - Buck A Ball - Stopspamstop.com
|
|
|
|
Nancy
Posts: 3626 Joined: 11/9/1999 From: Nebraska Status: offline
|
RE: Banner Ad Script - 4/29/2003 2:10:44
It might work better if you don' t try to do it as an include within an include? Although I think that' s the way I did it and it worked. Sorry I couldn' t be more help. Nancy
_____________________________
Easy Estimates -- is a simple to use tool to quickly build a Web site page enabling visitors to quickly and easily create an estimate of the cost of services that you provide.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|