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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    makeNewWindow function - multiple parameters

    How do I set different parameters in a document where I call a "makeNewWindow" function multiple times?

    I am working with an HTML document with multiple rollovers, each of which should call a different HTML document & make it a popup window. I'm not sure how to make these different HTML docs appear for each rollover and how to set up the x & y coordinates so they will be different each time.

    FYI - the rollovers also have DreamWeaver's "swapImage" function associated with each.

    Does this make sense? If so, please see the attached text file (an abridged version of the document, just to show the JS & where I've inserted it in the HTML section).

    Any help is much appreciated!

    Thanks,
    Jennifer
    Attached Files Attached Files

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Since you are already useing Dreamweaver, you can use it's built in ability to create popup windows. Hit Shift+F3 to open the 'Behaviors' window (DW's pet name for javascript stuff) and use the Plus Sign button to add 'Open Browser Window' to your links.

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    makeNewWindow function - multiple parameters

    Thanks, Beetle,

    I took your advice - the DW-generated function works well. I still wonder how I can set the x, y coordinates for the popup window, and how I can make the window close when the mouse moves off the image.

    Any advice on this part? thanks!
    Jennifer

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well, come to think of it, that MM_openBrWindow function kinda sucks. Here' something better.

    Code:
    function popWin(nUrl,wName, w, h, l, t)
    	{
    	var features = "";
    	features += 'width='+w;
    	features += ',height='+h;
    	features += ',left='+l;
    	features += ',top='+t;
    	var poppedWin = window.open(nUrl,wName,features);
    	}
    Then to call the function, use this
    Code:
    popWin('page.htm','myWin',300,400,100,50);
    This will open page.htm in a window named 'myWin' that is 300x400 and 100px from the left, and 50px from the top.
    Last edited by beetle; 08-19-2002 at 08:44 PM.

  • #5
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    then, to close the window....
    Code:
    function closeWin() {
    	if (poppedWin)
    		popopedWin.close();
    	}
    
    <a href="whaveter.htm" onMouseOut="closeWin()">Link</a>

  • #6
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmmm, still having trouble (sorry to be a pest)...

    The window opens using the function popWin ; however, the size and coordinates I input don't seem to make a difference.

    I can't get the closeWin function to work - being so new at this, maybe I've forgotten something...

    Thanks for all your help! I wish I could somehow return the favor!
    Attached is the code, as I inserted it. Please let me know if the error I've made jumps out at you - it's probably obvious to the experienced JS writer!

    Jennifer
    Attached Files Attached Files

  • #7
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, let's take a look at what you've got, and what you need. First, what you got
    Code:
    <a href="/products/con_div.htm" onMouseOver="MM_swapImage('prod_menu_r2_c2','','fireworks/prod_menu_r2_c2_f2.gif',1);popWin('product_win/contract.htm','contract','width=400,height=100,left=760,top=180')" onMouseOut="MM_swapImgRestore();" "closeWin('contract')">
    Now, for what you need:
    Code:
    <a href="/products/con_div.htm" onMouseOver="MM_swapImage('prod_menu_r2_c2','','fireworks/prod_menu_r2_c2_f2.gif',1);popWin('product_win/contract.htm','contract',400,100,760,180)" onMouseOut="MM_swapImgRestore();closeWin();">


  •  

    Posting Permissions

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