Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-10-2004, 11:15 PM   PM User | #1
Flip21
New to the CF scene

 
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Flip21 is an unknown quantity at this point
Javascript Pop-Up Window Help Needed

There are two ways to fix this problem, but I haven't been able to figure out either. When someone goes to my site, I want a javascript popup to open on the right side and I want it to always be on top. I've figured everything out and gotten it to work with the following code, but I can't figure out how to implement the always on top javascript code (<BODY onBlur="window.focus();"> ) into the pop-up window.

Here is the code I'm using, placed in the body of the main page:

<script language=JavaScript>
var win=window.open('a.html' ,'_BLANK'," toolbar=no,location=no,status=no,menubar=no,scroll
=no,width=X,height=Y,left=0,fullscreen=1,top=
0,resizable=no");
win.resizeTo(X, Y);
win.moveTo(X, Y);
win.document.write("<html><Head><Title>TITLE</Title></Head><body topmargin=0 leftmargin=0><img src='http://site.jpg' width=X height=Y alt='' border=0></body></html>");
</script>

So I either need to know how to work the onBlur code snippet into the aforementioned code, or how to make the window the code creates load another page with the onBlur code, although the former would be better.

Also, what code could be inserted to make the pop-up automatically close when the user goes to a different page from the one generating the pop-up?

THANK YOU IN ADVANCE
Flip21 is offline   Reply With Quote
Old 08-11-2004, 12:06 AM   PM User | #2
canadianjameson
Senior Coder

 
Join Date: Jul 2003
Location: My pimped-out igloo in Canadia
Posts: 1,966
Thanks: 36
Thanked 0 Times in 0 Posts
canadianjameson is an unknown quantity at this point
Code:
<script language="JavaScript">
window.open('http://www.yourdomain.com','windowname','
height=320,width=320,scrollbars,resizable'); 
</script>
place this just below the <body> tag and it should do the trick

as for the closing when the user navigates away, try this:

Code:
<script language="JavaScript">
window.open('http://www.yourdomain.com','windowname','
height=320,width=320,scrollbars,resizable,dependant'); 
</script>
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
canadianjameson is offline   Reply With Quote
Old 08-11-2004, 12:14 AM   PM User | #3
canadianjameson
Senior Coder

 
Join Date: Jul 2003
Location: My pimped-out igloo in Canadia
Posts: 1,966
Thanks: 36
Thanked 0 Times in 0 Posts
canadianjameson is an unknown quantity at this point
i use this:

Code:
<script type=text/javascript> 
function newWin(urlLoc) {
  _winName = "popupSelect";
  _info  = "toolbar=no";     // yes|no 
  _info += ",location=no";   // yes|no 
  _info += ",directories=no";// yes|no 
  _info += ",status=no";    // yes|no 
  _info += ",menubar=no";    // yes|no 
  _info += ",scrollbars=no";// yes|no 
  _info += ",resizable=yes"; // yes|no 
  _info += ",dependent";     // close the parent, close the popup, omit if you want otherwise 
  _info += ",height=250";
  _info += ",width=425";
  _info += ",left=150";
  _info += ",top=100";
  DispWin=window.open(urlLoc,_winName,_info);
} 
      </script>
and then
Code:
<body ... >
<a href="javascript:newWin('blahblah.htm')">
modify the above to a window.open
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
canadianjameson is offline   Reply With Quote
Old 08-11-2004, 12:27 AM   PM User | #4
Flip21
New to the CF scene

 
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Flip21 is an unknown quantity at this point
Is there a way to make it load an image instead of a url?
Flip21 is offline   Reply With Quote
Old 08-11-2004, 01:19 AM   PM User | #5
Flip21
New to the CF scene

 
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Flip21 is an unknown quantity at this point
I'm not sure what dictates the "always on top" out of what you posted..
Flip21 is offline   Reply With Quote
Old 08-11-2004, 04:38 PM   PM User | #6
canadianjameson
Senior Coder

 
Join Date: Jul 2003
Location: My pimped-out igloo in Canadia
Posts: 1,966
Thanks: 36
Thanked 0 Times in 0 Posts
canadianjameson is an unknown quantity at this point
to my knowledge (in the first script), not specifying a position defaults it to top=0px, left=0px. but thats just an educated guess

as for the image. in short, no. that would be asking the image to simply float in space.

the web page is just a container, if you will, for all the objects to be placed in. you need a url.

however you can give the semblance of a single image floating using <div>'s.
do a forum search on "floating div" and you should find a prewritten script or two to do exactly what you want.
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
canadianjameson is offline   Reply With Quote
Old 08-27-2004, 10:45 PM   PM User | #7
Supaskrilla.TK
New to the CF scene

 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Supaskrilla.TK is an unknown quantity at this point
Javascript Pop up help...

Im in no way a coder.. but ive been trying to get help with this problem for a few months..and i havent found any help..

Im just simply trying to get my Geocities.com page to load once my .Tk site is accessed.

Like a Full screen Javascript pop up.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600');");
}
// End -->

<title>Enter ME!!!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#000000">

<BODY onLoad="javascript:popUp('http://www.geocities.com/supaskrilla/main.html')">
</body>
</html>
Any guesses why its not working?
Supaskrilla.TK is offline   Reply With Quote
Old 08-28-2004, 01:27 AM   PM User | #8
justame
Regular Coder

 
Join Date: Jun 2002
Posts: 676
Thanks: 1
Thanked 0 Times in 0 Posts
justame is on a distinguished road
sup...
"quote...Any guesses why its not working?...endquote"

ummm...just a guessing®...but you have/had TWO body tags...:O(


<body bgcolor="#000000">

<BODY onLoad="javascript:popUp('http://www.geocities.com/supaskrilla/main.html')">
</body>


n' just a ps®...
hugs n' welcome to the forum...:O)))
justame is offline   Reply With Quote
Old 08-28-2004, 05:46 AM   PM User | #9
Supaskrilla.TK
New to the CF scene

 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Supaskrilla.TK is an unknown quantity at this point
Alrighty

Worked! thanks
Supaskrilla.TK is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:16 PM.


Advertisement
Log in to turn off these ads.