我试图使用jQuery的翻转(淡入)替换图像,你可以看到这个底部的工作离开这里:为什么这个jQuery图像交换无法在Chrome和Firefox中
http://www.anzie.com/index_rollover.php
但是,在铬中,它只是渐近近乎不透明。并在第一次加载Firefox时,我会在左上角看到一个小蓝框(好像它不在位置)。但后来刷新它在Firefox中工作。这在我自己的机器上完美地工作,当我在线尝试时它不起作用。这导致我不能及时加载图像?我不知道该怎么做..
这里是我的PHP:
<a href="<?php echo tep_href_link(FILENAME_EVENTS); ?>"><img src="images/home_buttons/water_bag.jpg" alt="watch la vie en couleur" border="0" align="left" hoverImg="images/home_buttons/water_bag-hover.jpg" /></a>
这里是JavaScript:
<script type="text/javascript">
$(document).ready(function() {
$('body').find('*[hoverImg]').each(function(index){
$this = $(this)
$this.wrap('<div>')
$this.parent().css('width',$this.width())
$this.parent().css('height',$this.height())
$this.parent().css('background-image',"url(" + $this.attr('hoverImg')+")")
$this.hover(function() {
$(this).stop()
$(this).fadeTo('',.01)
},function() {
$(this).stop()
$(this).fadeTo('',1)
})
});
});
</script>
嗯,我没有在html中设置的图像domeves。所以我很确定,修复它。那谢谢啦! – Sackling 2012-02-24 05:03:52
我认为你的脚本几乎是现货,只是一个div造型问题(在IE中工作)。把你的身高/宽度投入瓦尔并通过铬进行调试。 :) – 2012-02-24 05:04:25
我无法对脚本进行任何评价。它在@Diodeus的前一个问题中给了我 – Sackling 2012-02-24 05:48:25