Hi guys, anyone know if it is possible to launch different size popups from the same page and where i might find the code, thanks again Dave.
Hi guys, anyone know if it is possible to launch different size popups from the same page and where i might find the code, thanks again Dave.
Hi guys, anyone know if it is possible to launch different size popups from the same page and where i might find the code, thanks again Dave.
Hi Dave ...
Very simple to do by linking to an external .js for all your popups.
1. Create a file called "whatever.js" and add this :
2. Link to it from your HTML page :
<SCRIPT language="JavaScript" src="whatever.js" type="text/javascript"></script>
3. Add your onunload in the body tag :
onUnload="closePopP()"
4. Call your popup like this :
And of course, you can change the above attributes (url, size, scrolls etc) with each link.
Hope that helps.
cfn ... Jen
Jen Worden
Web Developer
www.meadoworks.com
Thanks for your help once again jen this is exactly what i was after, keep up the great work, regards Dave.
<blockquote>onclick="javascriptpenPopP();"</blockquote>
Oops, quick correction to the HTML part: don't include the 'javascript:' bit - that's for javascript URLs (eg. <a href="javascript:doSomething();"> - incidentally javascript URLs are almost always the wrong thing to do and are best avoided). 'onXXX' event handlers are direct JavaScript of course, no prefix needed.</p>
Another issue is that with this form, the main window will still navigate to "yourlink.html" after the popup is opened. If following the link is not desired behaviour (it usually isn't), the onclick handler should return false (<code>onclick="openPopP(...); return false;"</code>) to stop the link working.</p>
My favoured approach is to use <code>this.href</code> in the call to the function, so you only have to write the link URL once, in the href, to make the popup use the same link (non-JavaScript browsers can still follow the link of course just not in a popup). Also I like to put a <code>return false;</code> at the end of the open-popup function so I can write just the following HTML:</p><div><code></code><a href="page.html" onclick="return popup(this.href, ...);"></div>
Doh! Thanks Andrew for correcting those - 'twas a long day, I guess. :0
PS. Just noticed your welcome message, Mickie, thanks! (I've been lurking around, in between canoe/kayak trips [img]/infopop/emoticons/icon_smile.gif[/img] ;, so many helpful responses that I don't have to interject as often!)
[This message was edited by Jen Worden on August 14, 2001 at 08:17.]
Thankyou guys for the help,keep up the good work regards Dave.
Bookmarks