SitePoint Enthusiast
Hi, can someone tell me how do I make a popup window to appear when someone clicks on a banner ad?
------------------
Lazarus (8946037)
http://www.moviem.com
Hi,
Combine the pertinent banner code and the popUp window into a function, then change your banner link to something like:
<a href='javascript :void()' onClick='popBanner(1)'><img src="banner imgsrc"></a>
function popBanner(banNum)
{
window.open(.....) or alert(....)
switch (banNum)
{
case 1:
....banner1 redirect code...
break;
case 2:
....banner2 redirect code...
break;
}
}
Vinny
------------------
my site:GrassBlade: cut&paste javascript
moderator at:The JavaScript Place Forums
Javascript City
SitePoint Enthusiast
How am I suppose to place the function in? I'm a loser at Javascript. Do I need to add the lines of the function too? What are the (....) for?
Hi,
The function goes between your head tags, like most javascript functions. The "(...)" is where the window.open parameters go (url,winName,width....)
If the above still makes no sense:
1) buy a javascript book for beginners (SAM's Javascript in 24 Hours is good)
2) see the javascript primer at http://www.htmlgoodies.com (I think kevin yank has tutorials at his site, also)
Vinny
------------------
my site:GrassBlade: cut&paste javascript
moderator at:The JavaScript Place Forums
Javascript City
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks