This code
var offset = $('#snapwrap_inner').offset();
alert(offset.left)
in FF returns 0px but in Opera and Chrome is auto. How can I get real offset value?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think at least chrome is running the code before the entire window loads, which in that case you wouldn’t be able to tell the offset relative to the document. try putting that var alert in an if statement and see if it works:
$(window).load(function() {
var offset = $(‘#snapwrap_inner’).offset();
alert(offset.left);
});