Results 1 to 10 of 10

Thread: Help with code for pop up window

  1. #1
    Join Date
    Dec 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Smile Help with code for pop up window

    Hi Sorry not sure if this is in the right place but here goes what i am trying to do is create a pop (Already done) but now what i would like to do is give people the chose of where to go when it closes example <go here> <or here> then it loads in the main screen not the pop up bit like a confirm button but i would like it to be multiple choice rather then just close is this possible?

    Any help would be gratefully received

  2. #2
    Join Date
    Dec 2009
    Location
    North Carolina
    Posts
    71
    Thanks
    13
    Thanked 3 Times in 3 Posts

    Default

    Could you post the pop up code so it can be modified? I'm not sure here, but is it something as simple as put this in the buttons tag:

    onClick="window.location='PUT_LINK_HERE';"
    If I'm misunderstand let me me know, I'm going the simple route instead of overthinking it

    Tim

  3. The Following User Says Thank You to twQ For This Useful Post:

    tricky (12-11-2009)

  4. #3
    Join Date
    Dec 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    that's what i tried but it opens in the same window as the pop up thanks though,
    all the pop up does is give a little message here is the code
    Code:
    <body>
    <body bgcolor="000000">
    <center>
    <applet CODE="ProScroll" WIDTH="500" HEIGHT="60">
      <param name="TEXT"
      value="$ #bold##cyan#HAPPY NEW YEAR TO ALL OUR CHATTERS, THANK YOU FOR MAKING THIS ROOM SUCH A GREAT PLACE TO COME TO CHAT AND MEET PEOPLE, WE WISH YOU ALL THE BEST FOR  #red#2#green#0#blue#1#yellow#0 #cyan#LETS HOPE WE CAN KEEP IT GOING">
      <param name="STYLE" value="bold">
      <param name="SIZE" value="22">
      <param name="SPEED" value="fast">
    
    </applet>
    <br>
    <APPLET CODE="Firework.class" WIDTH="500" HEIGHT="340">
                       <PARAM NAME="AnimationSpeed" VALUE="50">
                       <PARAM NAME="RocketSoundtrack" VALUE="fire.au">
                       <PARAM NAME="RocketStyleVariability" VALUE="10">
                       <PARAM NAME="MaxRocketNumber" VALUE="9">
                       <PARAM NAME="MaxRocketExplosionEnergy" VALUE="850">
                       <PARAM NAME="MaxRocketPatchNumber" VALUE="90">
                       <PARAM NAME="MaxRocketPatchLength" VALUE="68">
                       <PARAM NAME="Gravity" VALUE="400">
                       </applet>
    <br>
    <input type="button" value="plain" onClick="window.location='http://www.sunflowerspetal.com/chatroom1.html';">
    <input type="button" value="Sunflower" onClick="window.location='http://www.sunflowerspetal.com/chatroom2.html';">
    Hope that helps

  5. #4
    Join Date
    Dec 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    P.S i was also toying with the idea of making it a timed window bit like a intro page but only as a pop up sorry if i sound a novice it's probably cause i am just looking to learn

  6. #5
    Join Date
    Dec 2009
    Location
    North Carolina
    Posts
    71
    Thanks
    13
    Thanked 3 Times in 3 Posts

    Default

    I believe this might be what your looking for:

    <input type="button" value="plain" onClick="window.open('http://www.sunflowerspetal.com/chatroom1.html');">
    <input type="button" value="Sunflower" onClick="window.open('http://www.sunflowerspetal.com/chatroom2.html');">
    More info on the window.open object: http://www.w3schools.com/jsref/met_win_open.asp


    Let me know if its not, and hey I'm not exactly an expert here we all gotta learn. Also if your still interested in the timer thing let me know and I'd be glad to help you with that.

    Tim

  7. The Following User Says Thank You to twQ For This Useful Post:

    tricky (12-12-2009)

  8. #6
    Join Date
    Dec 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Thanks Tim been a great help

    OK getting on the right lines thanks i think it might be better though for the timed one as the pop up didn't close on clicking

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

    Put all of these files in the same folder:

    index.htm:
    _______________
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    </head>
    <body>
    <a href="popup.htm" target="_blank" onclick="window.open(this.href, this.target, 'width=300, height=300');return false">Pop</a>
    </body>
    </html>
    popup.htm:
    _______________
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript">
    function closeLaunch(url){
    	if(!self.opener){
    		return true;
    	}
    	self.opener.location.href = url;
    	self.close();
    	return false;
    }
    </script>
    </head>
    <body>
    <div>
    <a href="somePage.htm" onclick="return closeLaunch(this.href);">Some Page</a><br>
    <a href="anotherPage.htm" onclick="return closeLaunch(this.href);">Another Page</a>
    </div>
    </body>
    </html>
    somePage.htm:
    _______________
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    </head>
    <body>
    <div>
    Some Page
    </div>
    </body>
    </html>
    anotherPage.htm:
    _______________

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    </head>
    <body>
    <div>
    Another Page
    </div>
    </body>
    </html>
    Any questions?
    - John
    ________________________

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

  10. #8
    Join Date
    Dec 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    thanks John

    Sadly yes one quetion does this mean i have to re write all the pages or can i juat add what you have written to them and do i need to keep them in the same folder? Or can they be moved and the URL changed

  11. #9
    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 don't see how that's sad.

    Perhaps some or all of the pages must be on the same domain. The ones in my example must be in the same folder though, only because they reference each other. As long as the URLs used for the links are valid, things should be fine.

    I wrote my HTML code to be valid to the DOCTYPEs used for each, though unless your code is extremely invalid, browsers will ignore minor deviations from the standards. The important parts are the javascript code in the onclick events and the one script. These javascript codes may (all or some) be external to the pages if you like, and this is generally recommended (javascript should be external), but not necessary.

    Basically these pages are just templates. You may either add to them or lift the javascript from them to apply as required to your existing pages.

    If you have a problem doing either:

    Please post a link to the pages on your site that contain the problematic code so we can check it out.
    - John
    ________________________

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

  12. The Following User Says Thank You to jscheuer1 For This Useful Post:

    tricky (12-12-2009)

  13. #10
    Join Date
    Dec 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Thanks John

    Seems to be working great thank you for the assistant guys feel free to see you work in action this is just the prototype mind the full version won't be around till after christmas (I like to get things sorted early) www.sunflowerspetal.com/newyear/popuptest.html if there are any errors feel free to let me know i always welcome comments good or bad they all help

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
  •