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

    dropdown menu help

    ok i have some dropdown menues and i want the links in them to open in new pop up windows that have a fixed size and whatnot so what do i do to get this.

    alright thanks alot
    Last edited by civilaxis; 10-02-2002 at 09:24 PM.

  • #2
    New Coder
    Join Date
    Aug 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you mean like this?

    (in header)

    <script language="JavaScript">
    <!-- hide from JavaScript-challenged browsers
    function openWindow(url) {
    popupWin = window.open(url,'new_page','width=500,height=320,scrollbars=yes')
    }
    function openWindow2(url) {
    popupWin = window.open(url,'new_page','width=640,height=420,scrollbars=yes')
    }
    // done hiding -->
    </script>


    (in body)


    <b>Example Drop Down Box with open new window:</b>
    <br>
    <form name="form">
    <select name="links">
    <option value="select">Please select
    <option value="JavaScript:openWindow('URL')">URL number one
    <option value="JavaScript:openWindow2('URL')">URL number two

    </select>
    <INPUT type="button" name="go" value="Go" onClick="window.location=document.form.links.options[document.form.links.selectedIndex].value">

    I think that should do it... if you want all the popups the same size then you dont need the openwindow2, if you want more then two then just copy/paste and change the 2 to 3. you can change the sizes of them yourself and make no scrollbars if you want.

  • #3
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the section i put in bold are the actual popups configuration section

    here are some options
    window.open("about:blank","Popup","width=100 height=100 toolbar=0 location=0 menubar=0 status=0 directories=0 scrollbars=0 resizable=0 copyhistory=0");

    <form>
    <select onChange="PopUpName=window.open('','PopUpName');PopUpName.location=options[selectedIndex].value;">
    <option value="http://www.website.com">website.com</option>
    <option value="http://www.webpage.com/">webpage.com</option>
    </select>
    </form>

    and here are a few more dropdown options

    instant page load

    <form>
    <select onChange="location=options[selectedIndex].value;">
    <option value="http://www.website.com">website.com</option>
    <option value="http://www.webpage.com/">webpage.com</option>
    </select>
    </form>

    load page with button

    <form>
    <select name="menu">
    <option value="http://www.website.com">website.com</option>
    <option value="http://www.webpage.com/">webpage.com</option>
    </select>
    <input type="button" onClick="location=this.form.menu.options[this.form.menu.selectedIndex].value;" value="GO">
    </form>

    load into specific frame

    <form>
    <select name="menu">
    <option value="http://www.website.com">website.com</option>
    <option value="http://www.webpage.com/">webpage.com</option>
    </select>
    <input type="button" onClick="top.frames['FrameName'].location=this.form.menu.options[this.form.menu.selectedIndex].value;" value="GO">
    </form>




    there are a few, theres more the drop down can do though
    Last edited by cg9com; 10-03-2002 at 04:35 AM.

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.


  •  

    Posting Permissions

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