我终于有了这个工作现在,但想知道如何使用JQuery的动画功能,使背景图片更改褪色,当你悬停在首页上的列表项:
http://www.thebalancedbody.ca/
实现这一目标的代码是: –
$("ul#frontpage li#277 a").hover( function () { $('#homepage_container').css('background-image','url(http://www.thebalancedbody.ca/wp-content/themes/balancedbody_V1/images/nutrition_background.jpg)'); },function () { $('#homepage_container').css('background-image','url(http://www.thebalancedbody.ca/wp-content/themes/balancedbody_V1/images/default_background.jpg)'); } ); $("ul#frontpage li#297 a").hover( function () { $('#homepage_container').css('background-image','url(http://www.thebalancedbody.ca/wp-content/themes/balancedbody_V1/images/vibration_training.jpg)'); },'url(http://www.thebalancedbody.ca/wp-content/themes/balancedbody_V1/images/default_background.jpg)'); } );
等等
谢谢
乔纳森