Results 1 to 5 of 5

Thread: Javascript "SHOW" Browser Toolbar

  1. #1
    Join Date
    Sep 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Javascript "SHOW" Browser Toolbar

    Hi all - We've all seen the Javascript or whatever it is that opens a pop-up window and sets the property for show/hide parts of the browser ...

    openWindow('http://www.address','toolbar=no,location=no,etc. etc.')"

    My question is -- Is there a way to have a link in the "pop-up" window that goes to my site's home page (target _self) but resets the parts of the browser to "show".

    Basically, I've had instances where people enter my site via a pop-up window (it's the first page they see). I want to give them the option of going to my sites index page (or wherever) and when they do I want to give them back all of the browser properties. Make sense?

    If anyone can point me to a tutorial or sample that would be great. TY!

  2. #2
    Join Date
    Sep 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yeah, that makes sense - Thanks John.

    As always I was looking for the extremely-complicated way out. When all I needed to do was to close the current window and open a new one. bingo!

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I deleted that because it won't really work. It won't work out if the user has new windows set to open in tabs, because that tab will become a tab in the chrome-less pop up. Barring that, many browsers will close the current window before opening the new one. That part can be dealt with like so:

    Code:
    <a href="http://www.address" target="_blank" onmouseup="setTimeout('self.close()',200);return true;">Get your Window Back</a>
    But, there is no way to override the user's settings to open a new window in a tab other than opening another pop up. You could make this be a pop up with full chrome and a large percentage of the screen, but the code for that would be a bit more involved. I'll get back to you on that if I get it worked out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This works out pretty well:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
    if(self.opener)
    var winback=function(ref){
    var nw=700, nh=500;
    if(screen.availWidth){
    nw=Math.floor(screen.availWidth*.9);
    nh=Math.floor(screen.availHeight*.85);
    }
    window.open(ref,'','top=2,left=2,width='+nw+',height='+nh+',menubar,scrollbars,directories,status,location,resizable,toolbar');
    setTimeout('self.close()',200);
    }
    </script>
    </head>
    <body>
    <a href="http://www.address" onclick="if(winback){winback(this.href);return false;}">Get your Window Back</a>
    </body>
    </html>
    Last edited by jscheuer1; 07-17-2007 at 06:29 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Sep 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for working that out for me John - I'm going to implement it now.

    I think it's a useful script for a web designer/developers portfolio - because if a site is search engine optimized then theoretically (sp?) a visitor could enter the site via a portfolio pop-up window and not have the opportunity to see all of the designer/developers superb work ;-)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •