Gossamer Forum
Home : Products : Links 2.0 : Customization :

Anyone know how to do this? OR Can it be done?

Quote Reply
Anyone know how to do this? OR Can it be done?
Here is a tough one for you links gurus out there.

Can someone tell me how to have Links create a new window when someone clicks on the link? I do not mean by using the _blank method. What I need it to do is this -

1) Create a new window (maximized preferred)
2) No buttons
3) No url
4) No Menu choices

I can do this using regular javascript but not with using links. This is not for popup adds, this is to take someone to the site they chose and then allow them to close that current window without losing their location on my site.

Any ideas? Anyone??

TIA

CDitty
Quote Reply
Re: Anyone know how to do this? OR Can it be done? In reply to
In site_html.pl, sub site_html_link:

Replace the first "$output = qq|..." with this:

$output = qq|
<ul type=disc><li><$font><a href="#" onClick="window.open('$build_jump_url?$db_key=$rec{$db_key}','window$rec{$db_key}','width=640,height=480,directories=no,location=no,menubar= no,scrollbars=yes,status=no,toolbar=no,resizeable=yes,left=0,top=0,screenX=0,screenY=0');return false"
>$rec{'Title'}</a></font>|;

------------------
bj
studiosg - www.skymedia-graphics.com


Quote Reply
Re: Anyone know how to do this? OR Can it be done? In reply to
That works pretty good. Thanks. Here's another challenge for you. The window that pops up need the following....

1) Window needs to be maximized. (the 640x480 only applies to lower res.)
2) Able to close the window with a button
3) Also have the title of the site in the title bar.

Are these possible??

Thanks again

CDitty
Quote Reply
Re: Anyone know how to do this? OR Can it be done? In reply to
>1) Window needs to be maximized. (the 640x480 only applies to lower res.)
I came across an article on this, but I can't find it and I think only 4.0 browsers have the capability.

>2) Able to close the window with a button
This would be impossible unless you abandon #3 on this wish list. It's semi-complicated but I could do it if it was mission-critical.

>3) Also have the title of the site in the title bar.
The title of the site should be in the title bar if the page has something between the <title> tags. If you mean the title of your site, I could do that using the frames method I would use for #2.
Quote Reply
Re: Anyone know how to do this? OR Can it be done? In reply to
By title, I mean that I would like for it to have the site name that they are visiting in the title bar. I tried using $title in the tags but I get the url instead. Weird.
Quote Reply
Re: Anyone know how to do this? OR Can it be done? In reply to
 
1) Window needs to be maximized. (the 640x480 only applies to lower res.)

Just change the code he posted to say
width=* and height=*
That won't MAXIMIZE it, but it will make it the default size of their current window.



2) Able to close the window with a button


<A HREF="javascript:window.close()">Click Here to Close</A>

Thats the code to close it.. Thats not to hard eh?



3) Also have the title of the site in the title bar.

<script>
<!--
var updates_pop = null;
function revwindow() {
updates_pop = window.open("updates.html", "updates_pop", "width=*,height=*,scrollbars=1,status=yes");
}

// -->
</script>

<a href="javascript:revwindow()" onmouseover="window.status='Updates!.'; return true">Click Here for Pop Up News!</a><br>



Thats the JavaScript I use. Netsacpe is the only one that Supports A "Window is Maxamized" feature. Otherwise just use * to get the size they are currently browsing in.
This is the code I used for some pages I had pop up. Mine are all "click" to pop up but you can make them auto pop up if you like.

Need any more help feel free to e-mail.

crowe@darkspiral.com


------------------
The Crowe crowe@darkspiral.com
http://www.darkspiral.com
Quote Reply
Re: Anyone know how to do this? OR Can it be done? In reply to
Thanks for the help. But unfortunately, none of it worked. The height/width actually made it smaller. The window close didn't work either.

You can see what I mean and what I am trying to do at http://www.demo.redhotsites.com/links

Just go into any of the categories can click on the links.
Quote Reply
Re: Anyone know how to do this? OR Can it be done? In reply to
I went to the page, the window opened fine.

Here's the deal. the "*" makes it open to
the SAME size as the PARENT window. Like I said, ONLY netscape has a "MAXIMIZE" option.
If you want to get more complicated with
the JS, you could do a test and if it was NETSCAPE you could max, otherwise use "*" for the height and width.

As for the close, your useing frames.. totally different animal You'd have to make a double close statement for each one in the onclick, and I haven't tested that. However, just above your frame is the browsers own close button .. the x is just as easy to hit as the close this window link in what your doing with it.. True the link is cooler, but with frames is impractical.

And I dug up that link to using an INCLUDE for javascript rather than embedding it.
http://www.webreference.com/...lumn13/external.html This is really handy.



------------------
The Crowe crowe@darkspiral.com
http://www.darkspiral.com
Quote Reply
Re: Anyone know how to do this? OR Can it be done? In reply to
Just add <input type="button" value="Close Window" onClick="self.close();"> somewhere in that top frame if its built by the jump.cgi.

You don't need 'double close statements' or anything if you're just trying to close the window.

640x480 is the most common res, so even though making the window 640x480 isn't good style, it's the closest you can get to maximization for a wide audience.

Frames makes the title of the site problem different. I'll work on it, though Smile
------------------
bj
studiosg - www.skymedia-graphics.com




[This message has been edited by strew (edited January 01, 1999).]

Add this in nav.html:
<script language="JavaScript">
if (parent.main.document.title) { parent.document.title = parent.main.document.title }
</script>

[This message has been edited by strew (edited January 01, 1999).]
Quote Reply
Re: Anyone know how to do this? OR Can it be done? In reply to
Thanks, I'll try the close command. As for the frames and the title, I am creating the title in the jump.cgi if that helps any.