gpt4 book ai didi

javascript - 图片元素不适用于 onmouseover 和 onmouseout

转载 作者:行者123 更新时间:2023-12-03 00:49:39 26 4
gpt4 key购买 nike

有人知道如何让 picture 元素与 onmouseoveronmouseout 一起使用吗?

<picture>
<a href="#">
<img id="color-palette" class="u-max-full-width make-up-img"
src="images/home-page/desktop/EYES_ON_YOU_desktop_HP_NO_HOVER_1.jpg?$staticlink$"
srcset="images/home-page/desktop/EYES_ON_YOU_desktop_HP_NO_HOVER_1_@2x.jpg?$staticlink$"
onmouseover="this.src='images/home-page/desktop/EYES_ON_YOU_desktop_HP_HOVER_3.jpg?$staticlink$'"
onmouseout="this.src='images/home-page/desktop/EYES_ON_YOU_desktop_HP_NO_HOVER_1.jpg?$staticlink$'"
/>
</a>
</picture>

最佳答案

试试这个,我的 friend 。希望能有所帮助:))

<picture>
<a href="#">
<img src="URL OF FIRST IMAGE GOES HERE"
onmouseover="this.src='URL OF SECOND IMAGE GOES HERE';"
onmouseout="this.src='URL OF FIRST IMAGE GOES HERE';">
</img>
</a>
<picture>

//And this is a sample
<picture>
<a href="#">
<img src="http://nineplanets.org/planets.jpg"
onmouseover="this.src='http://nineplanets.org/planetorder.JPG';"
onmouseout="this.src='http://nineplanets.org/planets.jpg';">
</img>
</a>
<picture>

关于javascript - 图片元素不适用于 onmouseover 和 onmouseout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53107476/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com