SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: OnClick popup
-
Aug 1, 2000, 21:04 #1
- Join Date
- Aug 1999
- Location
- Singapore
- Posts
- 33
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Aug 2, 2000, 02:58 #2
- Join Date
- Feb 2000
- Location
- where the World once stood
- Posts
- 700
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Aug 2, 2000, 11:18 #3
- Join Date
- Aug 1999
- Location
- Singapore
- Posts
- 33
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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?
-
Aug 2, 2000, 13:26 #4
- Join Date
- Feb 2000
- Location
- where the World once stood
- Posts
- 700
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
Bookmarks