Change image onmouseover

后端 未结 8 2061
野趣味
野趣味 2021-01-01 21:47

What\'s the correct way to change an image on mouseover and back on mouseout (with/without jQuery)?


    

        
8条回答
  •  长情又很酷
    2021-01-01 22:40

    I know someone answered this the same way, but I made my own research, and I wrote this before to see that answer. So: I was looking for something simple with inline JavaScript, with just on the img, without "wrapping" it into the a tag (so instead of the document.MyImage, I used this.src)

    hover effect
    

    It works on all currently updated browsers; IE 11 (and I also tested it in the Developer Tools of IE from IE5 and above), Chrome, Firefox, Opera, Edge.

提交回复
热议问题