Actually $(myElement).outerHeight() would be better. You can pass 'true' to add the element's margins, or you could add a few pixels (+10) so your element is not jammed right up against the bottom of the screen.
On Oct 14, 4:23 am, Mark <[email protected]> wrote: > Try: $(myElement).css('height') > > Also this may be the wrong forum for this discussion > perhapshttp://groups.google.com/group/jquery-enis more relevant. > > 2009/10/14 Ivan <[email protected]> > > > Mark, great, thanks, this is what I thought to use! > > > So I need to figure out these 3 things > > 1) myWindowHeight: document.body.clientHeight seems to work in my set > > of browsers (IE8, FF3.5, Opera 10, Chrome 1, Safari 4), not sure about > > earliers. > > 2) myElementHeight: can't find yet... > > 3) currentScrollPosition: can't find yet... I need it to understand if > > I have to scroll, if element is in visible area - I don't. > > > Any ideas from JS gurus? :) > > > Regards, > > Ivan. > > > On Oct 14, 8:50 am, Mark <[email protected]> wrote: > > > Ivan, > > > > Try using the offset setting. > > > > Something like : > > > $.scrollTo($('#bottomElem'),1000,{offset:-1*(myWindowHeight-myElementHeight)}); > > > > Mark > > > > 2009/10/14 Ivan <[email protected]> > > > > > Hi All > > > > > I'm trying to use scrollTo() plugin. > > > > When user clicks on some button, I create a new element in the DOM at > > > > some place below this button. > > > > And if it's outside of visible page area - I want page to be scrolled > > > > to that new element. > > > > But I don't want to scroll till the element will be in the left-top > > > > corner, but till it will be in the bottom of the visible page area, > > > > but with all content shown. > > > > > I probably need to specify somehow position = the element - window > > > > height + element height. > > > > But I'm not so good in JavaScript. > > > > > Any help will be greatly appreciated! > > > > > Ivan..- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
