74
rated 0 times
[
76]
[
2]
/ answers: 1 / hits: 34968
/ 12 Years ago, mon, november 19, 2012, 12:00:00
I have a question about jQuery offset() function. I use it on my site to display email a friend window after clicking on email icon.
However, the window appears sticked to the right side of browser's window, not on the position of the icon. You can see it in action on http://pec.solarismedia.net/calendarday.html
$(.emailFriend).hide();
$(.emailIcon).on(click, function(e) {
$(.emailFriend).css({
position: absolute,
left: $(this).offset().left,
top: $(this).offset().top
}).fadeIn(500);
return false;
});
There is a picture showing the difference between intention and reality.
More From » jquery