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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Regular Coder
    Join Date
    Feb 2004
    Location
    Earth
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mouse over on a SELECT

    is there an easy way to do a mouseover on a SELECT (listBox)
    to get additional informations on its elements ?

    thank you

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Do you mean tooltips for select elements? Vladdy has a custom tooltip script.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You mean something like this:

    PHP Code:
    <html>
    <
    head>
    <
    script>
    function 
    bla(a){
    var 
    aa = new Array()
    for(
    i=0;i<a.options.length;i++){
    aa[i] = a.options[i].text;
    }
    document.getElementById('x').value aa[a.selectedIndex];
    }
    </script>
    </head>

    <body>
    <select id="select" size="3" multiple  onmouseover="bla(this)">
      <option selected>one</option>
      <option>two</option>
      <option>three</option>
    </select><br>
    show the selected option's text below<br>

    <input id ="x" size="10">
    </body>
    </html> 
    But I can not see the practical reason for this...??

    As a note: <option> tag does not support, as far as I know, onmouseover event, only <select> does.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #4
    Regular Coder
    Join Date
    Feb 2004
    Location
    Earth
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes a tooltip on <option> of a <SELECT> ... a normal tooltip is enough

    thank you

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    You can put custom tooltip in the select itself not to each option as there is no onmouseover event for option tag.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #6
    Regular Coder
    Join Date
    Feb 2004
    Location
    Earth
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok then .... thank you

  • #7
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by glenngv
    no onmouseover event for option tag.
    You sure? I just tried it and it worked flawlessly under Mozilla Firefox 0.8.

  • #8
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You sure? I just tried it and it worked flawlessly under Mozilla Firefox 0.8.
    It might be, but not with IE6

    You may try something like:

    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <
    html>
    <
    head>
    <
    script>
    function 
    bla(a,b){
    var 
    tx='<br>';
    var 
    aa = new Array()
    for(
    i=0;i<a.options.length;i++){
    aa[i] = a.options[i].text;
    tx tx+aa[i]+'<br>';
    }
    document.getElementById('x').innerHTML 'here you can choose:'+tx;
    document.getElementById('x').style.display b;
    }
    </script>
    </head>

    <body>
    <select id="select" onmouseover="bla(this,'inline')" onmouseout="bla(this,'none')">
      <option>one</option>
      <option>two</option>
      <option>three</option>
    </select><br>
    <br>
    <div id ="x" style="position:absolute; display:none; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000; width: 100;"></div>
    </body>
    </html> 
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    I always thought that title in select or option tag and onmouseover in option tag are not supported. But I realized now that this is only true in IE.

    This works in Mozilla:

    <select title="This is a select">
    <option value="blah blah" onmouseover="window.status=this.value" title="blah blah">item 1</option>
    <option value="hello" onmouseover="window.status=this.value" title="hello">item 2</option>
    <option value="hi" onmouseover="window.status=this.value" title="hi">item 3</option>
    </select>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #10
    Regular Coder
    Join Date
    Feb 2004
    Location
    Earth
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but you don't get a mouseover on each otption ... ?

  • #11
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    But the position of the tooltip for option tag is sometimes off. Sometimes it just blinks. I'm using Mozilla1.0. View the screenshot to see the tooltip way off mark.
    Attached Thumbnails Attached Thumbnails mouse over on a SELECT-tooltip.jpg  
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #12
    Regular Coder
    Join Date
    Feb 2004
    Location
    Earth
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm using firefox

  • #13
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    [quote
    I'm using firefox
    [/quote]

    Ask your self what the users of your site are using, not what are you...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #14
    Regular Coder
    Join Date
    Feb 2004
    Location
    Earth
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I use Firefox for quality and IE + Opera for testing

  • #15
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    So what exactly is the problem with Firefox?
    Have you tried the code I posted?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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