Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Pop Up Window difficulty pleaaase help.

  1. #1
    Join Date
    Feb 2008
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Pop Up Window difficulty pleaaase help.

    I no, this is a amateur problem one that is possibly worth a laugh for you vets, regardless I'm a graphics and flash guy not a coder (even html/dhtml)

    heres my problem.
    http://www.dynamicdrive.com/dynamicindex8/popwin.htm
    I'm using this script.

    I have a Splash (intro) page (located here http://www.kingstonpulse.com/Splash.html) I want my two images on this page to launch my portfolio (located at: http://www.kingstonpulse.com/Portfolio.html) in a pop up window with these specifications obtained by the code generator at the dynamicdrive website listed above (4th line):

    <script language="javascript" type="text/javascript">
    <!--
    /****************************************************
    Author: Eric King
    Url: http://redrival.com/eak/index.shtml
    This script is free to use as long as this info is left in
    Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
    ****************************************************/
    var win=null;
    function NewWindow(mypage,myname,w,h,scroll,pos){
    if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
    if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
    else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,re sizable=no';
    win=window.open(mypage,myname,settings);}
    // -->
    </script>


    I want the splash page to have the two images "launchwithintro.jpg and launchwithoutintro.jpg" to launch the popup site and it wont. I even tried just with text at the top and it doesnt even work.

    I suck at programming as previously mentioned.. please if some one could help that would be wonderful!!

  2. #2
    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

    It would help if you put the script on the page.
    - John
    ________________________

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

  3. #3
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Hi RylandT,
    You could give this script a try:
    Code:
    <script language="javascript">
    <!--
    function popupwindow(){
    	var mywindow;
    	var h;
    	var w;
    	var h1;
    	var w1;
    	h1 = 475;
    	w1 = 600;
    	h = screen.height;
    	w = screen.width;
    	h = ((h/2) - (h1/2));
    	w = ((w/2) - (w1/2));
    	mywindow = window.open("name of page you want to open","RylandT","status=0,location=0,menubar=0,toolbar=0,width=600,height=475,resizable=0");
    	mywindow.moveTo(w,h);
    }
    //-->
    </script>
    In your page, you could enable it during onLOAD or onClick. The choice is yours!.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  4. #4
    Join Date
    Feb 2008
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    hi. thank for the speedy reply guys.

    I tried the code below I put it on both pages and tried it in the head section and the body area and it wouldn't work...

    HTML Code:
    <script language="javascript">
    <!--
    function popupwindow(){
    	var mywindow;
    	var h;
    	var w;
    	var h1;
    	var w1;
    	h1 = 1024;
    	w1 = 768;
    	h = screen.height;
    	w = screen.width;
    	h = ((h/2) - (h1/2));
    	w = ((w/2) - (w1/2));
    	mywindow = 
    
    window.open("http://www.kingstonpulse.com/Portfolio.html","RylandT","status=0,locatio
    
    n=0,menubar=0,toolbar=0,width=768,height=1024,resizable=0");
    	mywindow.moveTo(w,h);
    }
    //-->
    </script>


    Here is the code to my Splash page where I am trying to link the images "EnterWithIntro.jpg and EnterWithoutIntro.jpg" to a load http://www.KingstonPulse.com/Portfolio.html in the pop up window.

    http://www.KingstonPulse.com/Splash.html

    HTML Code:
    <html>
    <head>
    <title>index</title>
    <meta name="generator" content="Created Using Yahoo! PageBuilder 2.61.90">
    </head>
    <body bgcolor="#333332" link="#0000FF" vlink="#FF0000" text="#000000"
    
    <div id="root" style="position:absolute;top:0;left:0;width:670px;height:461px">
    <script>center();</script>
    <div style="position:absolute;left:155;top:173;width:382;height:276;">
    <table width=382 height=276 border=0 cellpadding=0 cellspacing=0><tr valign="top">
    	<td><img height=276 width=382 src="http://www.geocities.com/infimanelite/SPLASHdesign.jpg" border=0 ></td>
    </tr></table></div>
    <div style="position:absolute;left:251;top:339;width:152;height:80;">
    <table width=152 height=80 border=0 cellpadding=0 cellspacing=0><tr valign="top">
    	<td><a href="http://www.kingstonpulse.com/Portfolio.html"><img height=80 width=152 src="http://www.geocities.com/infimanelite/LAUNCHWITHOUTINTRO.jpg" border=0 ></a></td>
    </tr></table></div>
    <div style="position:absolute;left:410;top:291;width:104;height:71;">
    <table width=104 height=71 border=0 cellpadding=0 cellspacing=0><tr valign="top">
    	<td><a href="http://www.kingstonpulse.com/Portfolio.html"><img height=71 width=104 src="http://www.geocities.com/infimanelite/LAUNCHWITHINTRO.jpg" border=0 ></a></td>
    </tr></table></div>
    </div>
    </html>


    And heres the code to:
    http://www.KingstonPulse.com/Portfolio.html

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html40/loose.dtd">
    <html>
    <head>
    <title>Portfolio</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta name="author" content="">
    <meta name="generator" content="SWiSHmax http://www.swishzone.com">
    <meta name="description" content="Portfolio">
    <meta name="keywords" content="Web Design, Graphic Design, Showcase, Portfolio">
      <param name="movie" value="Portfolio.swf">
      <param name="bgcolor" value="#FFFFFF">
      <param name="quality" value="high">
      <param name="allowscriptaccess" value="samedomain">
      <embed type="application/x-shockwave-flash"
       pluginspage="http://www.macromedia.com/go/getflashplayer"
       width="1024" height="768"
       name="Portfolio" src="Portfolio.swf"
       bgcolor="#FFFFFF" quality="high"
       swLiveConnect="true" allowScriptAccess="samedomain"
      ></embed>
    </object>
    </center>
    </body>
    </html>


    does anyone no how to tell those 2 images to open the Portfolio.html page in a pop up window with the stipulations discussed above?

    Thank again, for the help.

  5. #5
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Hi rylandT
    What's this script: <script>center();</script>??...It causes errors
    Try editing your splash.html page to:
    HTML Code:
    <html>
    <head>
    <title>index</title>
    <meta name="generator" content="Created Using Yahoo! PageBuilder 2.61.90">
    <script language="javascript">
    <!--
    function popupwindow(){
    	var mywindow;
    	var h;
    	var w;
    	var h1;
    	var w1;
    	h1 = 1024;
    	w1 = 768;
    	h = screen.height;
    	w = screen.width;
    	h = ((h/2) - (h1/2));
    	w = ((w/2) - (w1/2));
    	mywindow = window.open("http://www.kingstonpulse.com/Portfolio.html","RylandT","status=0,location=0,menubar=0,toolbar=0,width=768,height=1024,resizable=0");
    	mywindow.moveTo(w,h);
    }
    //-->
    </script>
    </head>
    
    
    <body bgcolor="#333332" link="#0000FF" vlink="#FF0000" text="#000000">
    <div id="root" style="position:absolute;top:0;left:0;width:670px;height:461px">
    <div style="position:absolute;left:155;top:173;width:382;height:276;">
    <table width=382 height=276 border=0 cellpadding=0 cellspacing=0><tr valign="top">
    	<td><img height=276 width=382 src="http://www.geocities.com/infimanelite/SPLASHdesign.jpg" border=0 ></td>
    </tr></table></div>
    <div style="position:absolute;left:251;top:339;width:152;height:80;">
    <table width=152 height=80 border=0 cellpadding=0 cellspacing=0><tr valign="top">
    	<td><a href="http://www.kingstonpulse.com/Portfolio.html"><img height=80 width=152 src="http://www.geocities.com/infimanelite/LAUNCHWITHOUTINTRO.jpg" border=0 ></a></td>
    </tr></table></div>
    <div style="position:absolute;left:410;top:291;width:104;height:71;">
    <table width=104 height=71 border=0 cellpadding=0 cellspacing=0><tr valign="top">
    	<td><a href="http://www.kingstonpulse.com/Portfolio.html"><img height=71 width=104 src="http://www.geocities.com/infimanelite/LAUNCHWITHINTRO.jpg" border=0 ></a></td>
    </tr></table></div>
    </div>
    
    </html>
    See if it helps
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  6. #6
    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

    Quote Originally Posted by rangana View Post
    Hi rylandT
    What's this script: <script>center();</script>??...It causes errors
    Try editing your splash.html page to:
    Code:
    <html>
    <head>
    <title>index</title>
    <meta name="generator" content="Created Using Yahoo! PageBuilder 2.61.90">
    <script language="javascript" type="text/javascript">
    <!--
    function popupwindow(){
    	var mywindow;
    	var h;
    	var w;
    	var h1;
    	var w1;
    	h1 = 1024;
    	w1 = 768;
    	h = screen.height;
    	w = screen.width;
    	h = ((h/2) - (h1/2));
    	w = ((w/2) - (w1/2));
    	mywindow = window.open("http://www.kingstonpulse.com/Portfolio.html","RylandT","status=0,location=0,menubar=0,toolbar=0,width=768,height=1024,resizable=0");
    	mywindow.moveTo(w,h);
    }
    //-->
    </script> . . .
    Could work, the main thing I was saying is that the script:

    Code:
    <script language="javascript" type="text/javascript">
    <!--
    /****************************************************
    Author: Eric King
    Url: http://redrival.com/eak/index.shtml
    This script is free to use as long as this info is left in
    Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
    ****************************************************/
    var win=null;
    function NewWindow(mypage,myname,w,h,scroll,pos){
    if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
    if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
    else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,re sizable=no';
    win=window.open(mypage,myname,settings);}
    // -->
    </script>
    should be on the page if you expect the script to do anything.

    Rangana is right about <script>center();</script> just messing things up. Rangana's script may work out better for you though, because its code is less confusing to look at.

    However, the script tag requires the type attribute and the language attribute should be omitted, as should the 'hiding' strings. In both of the above scripts I have red highlighted what should be removed and added background highlight to what is missing that I added.

    Also, I don't like:

    Code:
    mywindow.moveTo(w,h);
    though. The top and left can be set in the specifications, and should be, as more browsers will accept them there, as opposed to a moveTo().
    - John
    ________________________

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

  7. #7
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Anyway, mywindow.moveTo(w,h); could be deleted
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  8. #8
    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

    Quote Originally Posted by rangana View Post
    Anyway, mywindow.moveTo(w,h); could be deleted
    Oh sure. But what I was saying, and I haven't gone over any of the code involved here (yours or the code from DD as posted) to see if it really all makes sense, is that if you want left and top coordinates for a new window, they can be specified here:

    Code:
    window.open("http://www.kingstonpulse.com/Portfolio.html","RylandT","status=0,location=0,menubar=0,toolbar=0,width=768,height=1024,resizable=0");
    in what are know as the specifications. Another tip about these is that, once you specify anything in this section of the window.open() method, anything you leave out is the same as setting it to "no" or 0. So the above would be the same as:

    Code:
    window.open("http://www.kingstonpulse.com/Portfolio.html","RylandT","width=768,height=1024");
    Although many browsers will ignore it no matter what you do when some of these things, like status and realizable are set to "no" or 0.

    The top and left could be added:

    Code:
    window.open("http://www.kingstonpulse.com/Portfolio.html","RylandT","top="+h+",left="+w+",width=768,height=1024");
    Looking at this, a width and height of 768 and 1024 would be too tall for many monitors (most browsers would then give a shorter window) and not wide enough for some if your goal is to go full screen.
    - John
    ________________________

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

  9. #9
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Okay! Thanks for the input jscheuer1, I never thought that top and left coordinates could be in! Anyway, the height and width is not my desire!, though target=_blank could do it!

    I just specify the height and width to full screen as if it was a requirement as coded in post#4...
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  10. #10
    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

    Yeah. I was just trying to give you some pointers, as you seem well on your way already. And I do understand how it can be difficult to know what parameters to use for things like width, height, etc. dealing with code somebody else posted when perhaps they didn't or really couldn't consider the ramifications of their choices.
    - John
    ________________________

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

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
  •