开发者

jquery image-background chrome problem

开发者 https://www.devze.com 2023-04-07 18:13 出处:网络
This doesn\'t seem to work in chrome: $(function(){ $(\'body\').css(\'background-image\',\'url(/static/img/b1_left.png\');

This doesn't seem to work in chrome:

$(function(){
$('body').css('background-image','url(/static/img/b1_left.png');
}

when I apply it in css it works fine:

background-image: url('/static/img/b1_left.png');

in firefox both work fine.

I need it to work in jquery, to process hover events (when something is hovered, it and another element has to chang开发者_如何学JAVAe background)


Missing a parentheses:

$(function(){
  $('body').css('background-image','url("/static/img/b1_left.png")');
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号