开发者

jQuery - If ( "A" left value is equal to "B" width minus "C" width )

Title says it well:

If ( element-A's left value is equal to element-B's width m开发者_JS百科inus element-C's width )

http://jsfiddle.net/UAKXq/1

What am I doing wrong?


This one is correct

if (parseInt(A.css('left')) == B.width() - C.width()) {

http://jsfiddle.net/UAKXq/14/


use this

if(parseInt(A.css('left')) == (B.width() - C.width())) 


if( parseInt(A.css('left'),10) === parseInt(B.css('width'), 10) - parseInt(C.css('width'), 10)) { 
    $('body').css({ background: 'red' }); 
}

http://jsfiddle.net/UAKXq/20/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜