这可能是一个非常简单的问题,但如何在jQuery中获取元素的right偏移量呢?
I can do:
$("#whatever").offset().left;
and it is valid.
但似乎是:
$("#whatever").offset().right
没有定义.
So how does one accomplish this in jQuery?
Thanks!!
这可能是一个非常简单的问题,但如何在jQuery中获取元素的right偏移量呢?
I can do:
$("#whatever").offset().left;
and it is valid.
但似乎是:
$("#whatever").offset().right
没有定义.
So how does one accomplish this in jQuery?
Thanks!!
亚历克斯,加里:
根据要求,以下是我的 comments :
var rt = ($(window).width() - ($whatever.offset().left + $whatever.outerWidth()));
Thanks for letting me know.
在伪代码中,可以表示为:
The right offset is:
The window's width MINUS
( The element's left offset PLUS the element's outer width )