1

http://localboyoutfitters.com

Works fine in Chrome/Firefox/IE but only the third hover image works in Safari.

Here is my code for one of the images.. (my tab button is broke so sorry for bad formatting) (i have a bracket on the a href below but bc of my keyboard limitations I had to take it away)

<a href="http://localboyoutfitters.com/wp-content/uploads/2013/10/LBO_topoffer_SMnew.png">
<img src="http://localboyoutfitters.com/wp-content/uploads/2013/10/LBO_topoffer_SMnew.png" alt="LBO_topoffer_SMnew" onmouseover="this.src='http://localboyoutfitters.com/wp-content/uploads/2013/10/LBO_topoffer_SMhover.png'" onmouseout="this.src='http://localboyoutfitters.com/wp-content/uploads/2013/10/LBO_topoffer_SMnew.png'" width="300" height="200" class="alignnone size-full wp-image-205" />
</a>

This is placed in a Wordpress widget area.

If anyone has any solutions it would be greatly appreciated!

4

2 回答 2

-1

您可以在 Jquery 中轻松做到这一点,一些 javascript 代码不适用于其他浏览器,您可以检查 jquery,您必须创建一个函数。您必须添加以下代码:

<script>
       function mouse(){
            $(document).ready(function (){
                 window.location("anywebsite");
            });
        }
</script>




<img src="http://localboyoutfitters.com/wp-content/uploads/2013/10/LBO_topoffer_SMnew.png" alt="LBO_topoffer_SMnew" onmouseenter="mouse();" width="300" height="200" class="alignnone size-full wp-image-205" />
于 2013-10-16T22:34:43.283 回答
-1

最好使用 mouseenter 和 mouseleave:

<a href="http://localboyoutfitters.com/wp-content/uploads/2013/10/LBO_topoffer_SMnew.png">
<img src="http://localboyoutfitters.com/wp-content/uploads/2013/10/LBO_topoffer_SMnew.png" alt="LBO_topoffer_SMnew" onmouseenter="this.src='http://localboyoutfitters.com/wp-content/uploads/2013/10/LBO_topoffer_SMhover.png'" onmouseleave="this.src='http://localboyoutfitters.com/wp-content/uploads/2013/10/LBO_topoffer_SMnew.png'" width="300" height="200" class="alignnone size-full wp-image-205" />
</a>
于 2013-10-16T21:05:00.700 回答