Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: ScriptConfusion

  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Location
    holland
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy ScriptConfusion

    HI
    Im new with JavaScript and I have a question. I surfed dozins of forums 2 find the answer but I got all confused with so many (mostly just slightely different) codes & scripts.
    Here is what I want 2 know:
    I made a flash intro, and then a button appears, and when u click it, I want a popup window 2 open (not fullscreen, not centered).
    Now I collected many codes but I really cant seem 2 find out WHICH part I should paste WHERE...
    Could u please make an example (as for a child) 2 help me out?!
    Id appriciate it a lot!Thanxx!!

  • #2
    Regular Coder
    Join Date
    May 2002
    Location
    Helsinki, Finland
    Posts
    231
    Thanks
    0
    Thanked 1 Time in 1 Post

    Lightbulb

    It'll always help us, if you post an URL or your source code here. That helps us to offer you a firm and proper answer faster, when we know the "environment".

    So, post an URL or a part of your code.
    Zvona
    First Aid for
    Web Design

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts

  • #4
    New Coder
    Join Date
    Jun 2002
    Location
    Colorado, USA
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, let's see if I can break it down for you.
    First, the script you create with the two parts 1="head" in red and 2="body"in green you will cut and paste ---->

    <html>
    <head>
    <title>PopUpScript</title>
    <script>
    function PopUp(PopUpUrl){
    var ScreenWidth=window.screen.width;
    var ScreenHeight=window.screen.height;
    var movefromedge=0;
    placementx=500;
    placementy=300;
    WinPop=window.open(PopUpUrl,"","width=400,height=300,toolbar=0,location=0,directories=0,status=0,scr ollbars=1,menubar=0,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screen Y="+placementy+",");
    }
    </script>

    </head>
    <body onload="PopUp('http://www.A1ien51.8k.com')">
    </body>
    </html>


    Here it is used in a small page --->

    <html>

    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>This is it</title>
    <script>
    function PopUp(PopUpUrl){
    var ScreenWidth=window.screen.width;
    var ScreenHeight=window.screen.height;
    var movefromedge=0;
    placementx=500;
    placementy=300;
    WinPop=window.open(PopUpUrl,"","width=400,height=300,toolbar=0,location=0,directories=0,status=0,scr ollbars=1,menubar=0,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screen Y="+placementy+",");
    }
    </script>



    </head>

    <body>

    <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="200" id="AutoNumber1" height="1000">
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>
    <p>&nbsp;<img border="0" src="pic5.jpg" width="207" height="342">&nbsp;&nbsp; </p>
    <p><font size="7">This is it</font></p>
    <body onload="PopUp('http://codingforums.com/showthread.php?s=&threadid=392')">
    </body>

    </html>

    Note: 1, This <head> starts the head section and this </head> ends it. This <body> or <body background=somediscriptionofacolororgraphicfilesourcehere> starts the body section and this </body> ends it.
    Note: 2, I replaced the url in the green onload body tag with the url for this page so in this example you will see a moveable, scrollable popup of this post. This is where you put the url to the page you want in the popup. Be sure to put your url inside the (' and the ')"> parts
    Note: 3, You may need to make a blank type page to host your flash intro because this popup script is coded for url's and not a direct path to a folder or file.
    Last edited by newmate; 06-21-2002 at 10:05 AM.
    Editor; FrontPage 2002 (included in Office XP). Personal Operating System; Windows XP and ME. Browsers; Latest versions, NN, IE and Opera. Server running; RedHat Linux 7.2

  • #5
    New to the CF scene
    Join Date
    Jun 2002
    Location
    holland
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    THANXXX

    I wanna thank yall for your time & effort. Ill try all the tips and codes and then get bakc to U !!!!!!!!!!!

  • #6
    New to the CF scene
    Join Date
    Jun 2002
    Location
    holland
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    here the codes

    Okay, I did some homework--Ive visited popup generator, very handy!
    But I still cant make the button work in my flash intro...
    Ive also tried to work with your codes, Newmate, but unfortunately it didnt get me what I needed...thanx anyway!
    So heres the codes that I try 2 work with.
    First I give u the code of the button and what it does, so u get an impression of what I want 2 happen:

    <HTML>
    <HEAD>
    <TITLE>trial</TITLE>
    <script language=javascript>
    function openwindow()
    {
    window.open("http://www.mediaperspectief.nl", "openwindow", "width=300,height=300,left=50,top=50")
    }
    </script>
    </HEAD>

    <BODY bgcolor="#FFFFFF">
    <form> <center><p>&nbsp;<input type=button value="consultancy" onclick="openwindow()" NAME="consultancybutton"></p></center></form><!-- URL's used in the movie-->
    <!-- text used in the movie-->
    </BODY>
    </HTML>

    And heres the code for the flashmovie in which the button has to trigger the popup window, which is definitly not happening...

    <HTML>
    <HEAD>
    <script language=JavaScript>
    function openNewWindow(URLtoOPen, windowName, windowFeatures)
    {
    newWindow=window.open(URLtoOpen, windowName, windowFeatures);
    }
    </script>
    <TITLE>trialmovie</TITLE>
    </HEAD>
    <BODY bgcolor="#FFFFFF">
    <!-- URL's used in the movie-->
    <A HREF=javascriptpenNewWindow ('www.mediaperspectief.nl','thewin','height=300,width=400,top=50,left=50')"); }></A> <!-- text used in the movie-->
    <OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
    WIDTH=550 HEIGHT=400> swLiveConnect=true NAME=button.swf
    <PARAM NAME=movie VALUE="trialmovie.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="trialmovie.swf" quality=high bgcolor=#FFFFFF WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
    </OBJECT>
    </BODY>
    </HTML>


    Okay, beatiful if anyone could unsolve this mistery 4 me!!


    Petr@


  •  

    Posting Permissions

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