sina94 02-02-2004, 06:08 AM What I want is a popup like...
<a href="member.html" target="_blank">Member</a>
...But I want to be able to customize what the window looks like (width, height, scrollbars/no scrollbars, etc.). If you know how I can do this I'd appreciate the help. Mostly I just don't want pages and pages of javascript because I gonna have quite a few of these little guys.
zoobie 02-02-2004, 06:26 AM You may want to rethink your strategy as pop-ups are becoming a thing of the past due to abuse. This is javascript so try posting a few doors up.
rmedek 02-02-2004, 06:27 AM Hello,
Well, you'll have to use a little. w3schools (http://www.w3schools.com) has a bunch of good javascript tutorials. The one you want is here (http://www.w3schools.com/js/tryit.asp?filename=tryjs_openallwindow), the page is set up so you can play with the code and see the immediate effects. Hope this helps,
-Rich
zoobie 02-02-2004, 06:37 AM He wants inline like:
<a href="#" onclick='window.open("page.html", "", "width=500, height=400, toolbar=no, location=no, directories=no, status=no, menubar=no");'>Pop it</a>
Post in the javascript forum if you need more help
mindlessLemming 02-02-2004, 06:42 AM This is exactly what you're after.
It's the most user friendly way of going about it.
Users can click it, right-click (open new window) and even bookmark the link without getting a JS error.
<a href="http://www.youngpup.net/" title="YoungPup.net" onclick="window.open(this.href,
'popupwindow', 'width=800,height=600,scrollbars,
resizable,menubar=1,location=1,toolbar=1'); return false;"> YoungPup.net</a>
It comes from youngpup.net, hence the the link...
:thumbsup:
*edit: You beat me zoobie :)
zoobie 02-02-2004, 06:48 AM Heh heh...but that throws an error and is no different than <a href="http://yahoo.com">Yahoo!</a> if the whole window is replaced.
mindlessLemming 02-02-2004, 07:23 AM I must have stuffed it up when I copied from the source of my site...:o
Here it is again, no errors, user friendly...:D
<a href="http://www.youngpup.net/" title="YoungPup.net" onclick="window.open(this.href, 'popupwindow', 'width=800,height=600,scrollbars,resizable,menubar=1,location=1,toolbar=1'); return false;"> YoungPup.net</a>
ANdrew
zoobie: try it, it's very different to a standard <a>
sina94 02-02-2004, 07:48 AM \/Look Down\/
sina94 02-02-2004, 07:49 AM Hey, thanks for the help Zoobie. That's exactly what I was looking for, a simple inline code. My approach just wasn't the right approach. Only one question, what does the # stand for when you put in in the href=? As for the use of pop ups, that's what I needed to go with the flow of my site, regardless of whether their out of style or not. I have everything loading in an <iframe>, and I wanted a specific part to open outside of the <iframe> without moving people all over away from where they're at. I'll post a link here as soon as I get it all done so you'll see why they're so important. But thanks again for the help.
mindlessLemming 02-02-2004, 11:28 AM sina94, the problem with the code zoobie posted is that it will cause a javascript error if the user right clicks the link and chooses "open in new window".
This may not sound like a big problem, but if you we're using a page the you knew had its content within an iframe, wouldn't you open a link in a new window so as to not lose your place? So would I, and so would any seasoned web surfer.
The second code snippet I posted will not cause any such problem.
Merely a heads up :D
Andrew
|
|