drop down menus

Discussion in 'QnA (read only)' started by sridhar8310, Dec 10, 2004.

Thread Status:
Not open for further replies.
  1. sridhar8310

    sridhar8310 New Member

    Joined:
    Jul 6, 2004
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    0
    Recently I created a website for myself, I used the "select" HTML control and designed it, it's code is given below. Thee problem is that I can open up a page only when i change from one option to another but not when in the same option. Like in the "--header--" option in the menu is default selected, so if I press again header, it wont work since there is no change in the selection. Could anyone plz help me.
    Also if u could tell me how to show the menu when we hover the mouse, I would be grateful to u.
    -----------------------------------------------------------------------
    <STYLE type=text/css>.networkbarselect {
    FONT-SIZE: 11px; COLOR: #333333; FONT-FAMILY: Arial, Helvetica,sans-serif;BACKGROUND-COLOR: #f2f2f2
    }</STYLE>

    <SCRIPT language=JavaScript type=text/JavaScript>
    function MM_jumpMenu(targ,selObj,restore){
    var i;
    i=selObj.selectedIndex;
    selObj.selectedIndex=0;
    eval(targ+".location='"+selObj.options[i.value+"'");
    }</SCRIPT>

    <select class=networkbarselect onchange="MM_jumpMenu('window.document',this,1)">
    <option value=javascript:// selected>--header--</option>
    <option value=http://www.yahoo.com>yahoo</option>
    <option value=http://www.rediff.com>rediff</option>
    </select>
    ----------------------------------------------------
     
  2. icecoolz

    icecoolz Active Member

    Joined:
    Jul 30, 2004
    Messages:
    1,221
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Bangalore
    The select control behaves in the way which you have mentioned. Everytime you select an option in the control certain events get triggered and hence it implements whatever is there in the code of the event called. In your case since the --header-- is already selected even if you select it again nothing will happen as no even gets triggered.

    As for your second option use DHTML menus. They give you lot more flexibility and look very pretty too! Loads of tools are available to build them. Just google it!
     
  3. Deep

    Deep Version 2.0

    Joined:
    Jan 23, 2004
    Messages:
    977
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Mumbai
Thread Status:
Not open for further replies.

Share This Page