Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Javascript, IE and mouseover on select, option.

Javascript, IE and mouseover on select, option.

Scheduled Pinned Locked Moved Web Development
javascripthelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alsvha
    wrote on last edited by
    #1

    Hiya all. I stumpled on a problem one of my coworkers were having today, in that he'd like to fire an onMouseOver event on each option in a select-object. What ideally would should happen was that an image would be changed when the mouse hovers over the options in a select. This can be done with FireFox, but not with IE, by using onMouseOver on each option. something along this line: Option 1 Option 2 Now this works in FireFox, but unfortunally in IE, which is what the client is going to use. Does anybody know of a work-around or possible alternative implementation to this problem? With regards --------------------------- 127.0.0.1 - Sweet 127.0.0.1

    S 1 Reply Last reply
    0
    • A Alsvha

      Hiya all. I stumpled on a problem one of my coworkers were having today, in that he'd like to fire an onMouseOver event on each option in a select-object. What ideally would should happen was that an image would be changed when the mouse hovers over the options in a select. This can be done with FireFox, but not with IE, by using onMouseOver on each option. something along this line: Option 1 Option 2 Now this works in FireFox, but unfortunally in IE, which is what the client is going to use. Does anybody know of a work-around or possible alternative implementation to this problem? With regards --------------------------- 127.0.0.1 - Sweet 127.0.0.1

      S Offline
      S Offline
      Sushant Duggal
      wrote on last edited by
      #2

      Hi, You can perform the check in the select onChange event. Something like this: function selectExp() { alert(document.getElementById('ddlTest').options[document.getElementById('ddlTest').selectedIndex].value); } first second third fourth fifth sixth seventh eighth ninth tenth This wey you get the selected index or its value , accordingly you can put the code for different options. I hope this works for you. Thanks Sushant Duggal.

      A 1 Reply Last reply
      0
      • S Sushant Duggal

        Hi, You can perform the check in the select onChange event. Something like this: function selectExp() { alert(document.getElementById('ddlTest').options[document.getElementById('ddlTest').selectedIndex].value); } first second third fourth fifth sixth seventh eighth ninth tenth This wey you get the selected index or its value , accordingly you can put the code for different options. I hope this works for you. Thanks Sushant Duggal.

        A Offline
        A Offline
        Alsvha
        wrote on last edited by
        #3

        Thanks for the reply. The problem is that onChange dosen't fire until after the selection has been changed in which case the page changes, whereas the onMouseOver in Firefox would trigger as you use your mouse to "scroll" down the selection-choices, and you'd be able to see a preview before making the selection. I am "fearing"/thinking that we do need to go with an "onChange" to have compatibility with Internet Explorer, but seeing as this was a client request (*sigh*) I thought it was worth to see if there was a workaround for IE, to mimic the behaviour we see in Firefox. But thanks for your reply. With regards. --------------------------- 127.0.0.1 - Sweet 127.0.0.1

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups