...

View Full Version : Required popups - Just for the new board!



welo
06-13-2002, 02:45 AM
Oooooooo boy! A vigin forum! (rubbing hands together :D)

Here's a question: I've been considering how to make a page supposed to render in a popup (a slideshow, for instance), stay in the popup - e.g. when you use the url directly you still get the popup.

It's a tough issue. Theoretically you could do something akin to frame forcing. I even thought of causing the page to open a browser to open the popup then close the parent window, though if a search engine has the page logged, people will have their browsers inadvertantly closed.

Ideas?

Thejavaman1
06-13-2002, 02:48 AM
:eek: you deflowered it! :eek:

parent.location.go(-1);
window.focus();

would be my choice. I once was going to do something like this (had a working example until I formated), that makes it so your page is on top, but once they are done with it, they can close it and continue browsing... :)

Thejavaman1
06-13-2002, 02:49 AM
also welo on an unrelated note, have you seen this yet? http://wtc2002.com/start.lasso

welo
06-13-2002, 03:12 AM
I'll try it out Andrew, thanks. :)

Hadn't seen that WTC proposal yet. Looks like another one to add to the new Futures (http://photos.commemoratewtc.org/?direc=future&menu=1) photo gallery section (which also will be linked from a corresponding page in the History section (almost ready for launch - like by tomorrow).

However, long as you brought it up I'm preparing to align CWTC for endorsement of This Project (http://newwtcproject.com), which has the best feel of any WTC proposal I've seen thus far. I'll letcha know. ;)

Thejavaman1
06-13-2002, 03:22 AM
that would be increadably cool. And really big, wow, I know they are starting something on site 7 right now. There was an article in either the local paper (san diego union tribune) or the WSJ about their decission process. They are susposedly going to have the final project decided by december... :eek:

justame
06-13-2002, 04:33 AM
Originally posted by Thejavaman1
http://wtc2002.com/start.lasso

/me went to just a lookŪ @ it??? n' ummm sorrry dont have over 5 mins to wait via the ol' 28.8 dialup...lol...

jkd
06-13-2002, 05:16 AM
Perhaps a solution?

<script type="text/javascript">
window.onload = function() {
var newWin;
if (typeof window.popped == 'undefined' || !window.popped) {
newWin = window.open('yourpopupstuff');
newWin.popped = true;

window.location.replace('http://www.google.com');
// maybe history.back() would suffice
}
}
</script>

I basically check to see if you haven't assigned the popup window a boolean, popped. If undefined or doesn't evaluate to true, open the popup code you want, giving the new window the popped boolean. And then, to preserve the main window, replace the location with google's.

welo
06-13-2002, 09:27 AM
Thanks jkd. That's more what I had in mind. Lemme try it out! :)


Okay, that worked perfectly. For instance, Click Here (http://commemoratewtc.com/history/artwork/ideogram01.html). :D



<script type="text/javascript"><!--
window.onload = function() {
var PopUpUrl="http://commemoratewtc.com/history/artwork/ideogram01.html"
var newWin;
if (typeof window.popped == 'undefined' || !window.popped) {
newWin = window.open(PopUpUrl,"","width=472,height=422,toolbar=no,location=0,directories=0,status=0,scrollbars=no,menubar=0,resizable= 0");
newWin.popped = true;
window.location.replace('http://commemoratewtc.com/history/artwork/ideogram.php');
}
}
// -->
</script>



[edit#2]

Okay, just hit a minor glitch. If I open the popup from the page I get two popups, one of which contains the page I launch from. Go Here (http://commemoratewtc.com/history/artwork/ideogram.php) and click on the image to launch the popup. You'll see what I mean. :( Pretty close though. I suppose I could just target the page running in the popup, though it'll reload the existing page unnecessarily. Ideas?

[/edit#2]

jkd
06-13-2002, 07:12 PM
Whereever your PopUp() function is located that originally opens the popup, add at the end:

WinPop.popped = true;

I didn't have time to look through all of your source code, but a:
javascript:PopUp

In the location bar gave me:
[code]
function PopUp() {
var ScreenWidth = window.screen.width;
var ScreenHeight = window.screen.height;
var movefromedge = 0;
placementx = (ScreenWidth / 2) - ((670) / 2);
placementy = (ScreenHeight / 2) - ((490) / 2);
var PopUpUrl = "ideogram01.html"; WinPop = window.open(PopUpUrl, "", "width=472,height=422,toolbar=no,location=0,directories=0,status=0,scrollbars=no,menubar=0,resizable= 0,left=" + placementx + ",top=" + placementy + ",screenX=" + placementx + ",screenY=" + placementy + ",");
}

You would add that WinPop.popped = true right before the last }. :)

welo
06-13-2002, 07:45 PM
That's it! hehe :D

One lousy line I missed. Thanks Jason!

(btw, this officially makes you a CWTC coder in the contributors list; will email you in a minute ;) )

Quiet Storm
06-15-2002, 09:36 PM
Originally posted by welo
I even thought of causing the page to open a browser to open the popup then close the parent window, though if a search engine has the page logged, people will have their browsers inadvertantly closed.

Ideas?

I've been trying to do something like that on my site! Although I'm trying to use cookies to save the referrer URL so as to open that page again, once the surfer leaves my site... (haven't figured out how, yet)

Wow, cool! Someone thinks the same. :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum