2013-07-06 152 views
0

的作品,这是我使用了悬停在导航菜单物M代码: 是否有人可以帮助我找到Chrome和IEjQuery的悬停不会在Chrome和IE浏览器,但在FF

问题
$("#unlock_nav a").hover(function() { 
$(this).css('background-image', 'url(http://www.eileenfisher.com/ns/images/13f_m2/sbi_features/unlocked_season/but_' + $(this).attr('href').slice(1) +'_pink.png'); 

}, 

function(){ 
$(this).css('background-image', 'url(http://www.eileenfisher.com/ns/images/13f_m2/sbi_features/unlocked_season/but_' + $(this).attr('href').slice(1) + '_white.png'); 
    }); 
+1

悬停在Chrome浏览器工作正常。 http://jsfiddle.net/FgRRH/ –

+0

铬中的任何控制台错误? – krishgopinath

+0

您能否提供页面链接和/或html代码?什么切片()方法应该做的,到底是什么?你想删除href属性的第一个字符? – sinisake

回答

1

你忘了在背景图片url中放置紧箍。

试试这个:

$("#unlock_nav a").hover(function() { 
$(this).css('background-image', 'url(http://www.eileenfisher.com/ns/images/13f_m2/sbi_features/unlocked_season/but_' + $(this).attr('href').slice(1) +'_pink.png)'); 

}, 

function(){ 
$(this).css('background-image', 'url(http://www.eileenfisher.com/ns/images/13f_m2/sbi_features/unlocked_season/but_' + $(this).attr('href').slice(1) + '_white.png)'); 
    }); 

样品:http://jsfiddle.net/9nQdm/3/

+0

哇,你说得对。非常感谢,未知。不能相信我花了2天,看着这个......很好的帮助! – marb

相关问题