Just after I asked that getPos() function in iUtil.js of interface
package, I got the getPosition() should do the work. But as I used it
in IE browser, if the scrollbar is not scrolled, the result is good.
But as I scroll the scrollbar, the result is not correct, it seems
that it minuses scrollTop and scrollLeft value, but it's not I want.
So I had to recover my old version:
$.fn.coordinate = function(){
e = this[0];
var y = 0, x = 0;
do {
y += e.offsetTop || 0;
x += e.offsetLeft || 0;
e = e.offsetParent;
if (e) {
if(e.tagName.toLowerCase() == 'body') break;
var p = $(e).position();
if (p == 'relative' || p == 'absolute') break;
}
} while (e);
return {x:x, y:y};
}
--
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/