开发者

jQuery backgroundPosition conditional statement

开发者 https://www.devze.com 2023-02-22 20:04 出处:网络
I have this here: if($(\"a#type\").css(\'backgroundPosition\') == \'0px -40px\') //do something Which passes fine in Ch开发者_如何学编程rome/Safari but not in Firefox 4. Is this a bug in jQuery? Ha

I have this here:

if($("a#type").css('backgroundPosition') == '0px -40px')
//do something

Which passes fine in Ch开发者_如何学编程rome/Safari but not in Firefox 4. Is this a bug in jQuery? Has anyone else come across this? Is there a solution?


I think the syntax is like this:

if($("a#type").css('background-position') == '0px -40px')
0

精彩评论

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