jQuery: The Write Less, Do More JavaScript Library

Scroll so that an element is at the bottom of the viewport

View: New views
8 Messages — Rating Filter:   Alert me  

Scroll so that an element is at the bottom of the viewport

by Deniz Dogan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm looking for a JQuery plugin like scrollTo but which lets me scroll
the viewport so that the bottom of an element is at the bottom of the
viewport.

Is this possible with scrollTo? If so, how? Otherwise, is there any
other plugin I can use?

Re: Scroll so that an element is at the bottom of the viewport

by brian ally-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Off the top of my head, one idea would be to use jquery to add a
hidden/empty element after the one you want at the bottom, then use
the ID of the former to scroll to.

On Mon, Nov 2, 2009 at 5:28 AM, Deniz Dogan <deniz.a.m.dogan@...> wrote:
> I'm looking for a JQuery plugin like scrollTo but which lets me scroll
> the viewport so that the bottom of an element is at the bottom of the
> viewport.
>
> Is this possible with scrollTo? If so, how? Otherwise, is there any
> other plugin I can use?
>

Re: Scroll so that an element is at the bottom of the viewport

by unwired brain :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 2, 2009 at 11:28, Deniz Dogan <deniz.a.m.dogan@...> wrote:
> I'm looking for a JQuery plugin like scrollTo but which lets me scroll
> the viewport so that the bottom of an element is at the bottom of the
> viewport.
>
> Is this possible with scrollTo? If so, how? Otherwise, is there any
> other plugin I can use?

Hi there.
What about using some "basic" CSS? :)

#targetElementId {
    position: fixed;
    bottom: 0;
}

--
Massimo Lombardo
Linux user #437712

Re: Scroll so that an element is at the bottom of the viewport

by Ariel Flesler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

$.scrollTo('#elem', 1000, {
  over:{ top:1 },
  offset:{ top: -$(window).height() }
});

Haven't tried it, but this should do. If it doesn't, you could just
calculate the position using simple math.

--
Ariel Flesler

On Nov 2, 8:28 am, Deniz Dogan <deniz.a.m.do...@...> wrote:
> I'm looking for a JQuery plugin like scrollTo but which lets me scroll
> the viewport so that the bottom of an element is at the bottom of the
> viewport.
>
> Is this possible with scrollTo? If so, how? Otherwise, is there any
> other plugin I can use?

Re: Scroll so that an element is at the bottom of the viewport

by Rizky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi ariel,

great plugin here, i'm using it for my next project (if the marketing
guys could win the pitch). currently it's still a prototype.

i have a question as well. what should i do if i want to scroll to an
element and make it appear in the center of the viewport? all elements
are absolutely positioned.

thx for the help.

Re: Re: Scroll so that an element is at the bottom of the viewport

by Ariel Flesler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This should do.

$.scrollTo('#elem', 1000, {
 over:{ top:0.5 },
 offset:{ top: -$(window).height() / 2 }
});

On Sun, Nov 15, 2009 at 10:35 AM, Rizky <br4inwash3r@...> wrote:
hi ariel,

great plugin here, i'm using it for my next project (if the marketing
guys could win the pitch). currently it's still a prototype.

i have a question as well. what should i do if i want to scroll to an
element and make it appear in the center of the viewport? all elements
are absolutely positioned.

thx for the help.



--
Ariel Flesler
http://flesler.blogspot.com

Re: Scroll so that an element is at the bottom of the viewport

by Rizky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thx for the reply :)

doesn't work like i wanted to tho. but i'm gonna tweak it some more.
thx for the tips, i'll post the code and example later once i got it
working.


On Nov 16, 12:15 am, Ariel Flesler <afles...@...> wrote:

> This should do.
>
> $.scrollTo('#elem', 1000, {
>  over:{ top:0.5 },
>  offset:{ top: -$(window).height() / 2 }
>
> });
> On Sun, Nov 15, 2009 at 10:35 AM, Rizky <br4inwas...@...> wrote:
> > hi ariel,
>
> > great plugin here, i'm using it for my next project (if the marketing
> > guys could win the pitch). currently it's still a prototype.
>
> > i have a question as well. what should i do if i want to scroll to an
> > element and make it appear in the center of the viewport? all elements
> > are absolutely positioned.
>
> > thx for the help.
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com

Re: Scroll so that an element is at the bottom of the viewport

by gfranklin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is a new site with video tutorials that I recently found via
boagworld.com podcast. They have a video tutorial that is similar to
what you want.

http://jqueryfordesigners.com/fixed-floating-elements/

-G

On Nov 18, 10:56 am, Rizky <br4inwas...@...> wrote:

> thx for the reply :)
>
> doesn't work like i wanted to tho. but i'm gonna tweak it some more.
> thx for the tips, i'll post the code and example later once i got it
> working.
>
> On Nov 16, 12:15 am, Ariel Flesler <afles...@...> wrote:
>
> > This should do.
>
> > $.scrollTo('#elem', 1000, {
> >  over:{ top:0.5 },
> >  offset:{ top: -$(window).height() / 2 }
>
> > });
> > On Sun, Nov 15, 2009 at 10:35 AM, Rizky <br4inwas...@...> wrote:
> > > hi ariel,
>
> > > great plugin here, i'm using it for my next project (if the marketing
> > > guys could win the pitch). currently it's still a prototype.
>
> > > i have a question as well. what should i do if i want to scroll to an
> > > element and make it appear in the center of the viewport? all elements
> > > are absolutely positioned.
>
> > > thx for the help.
>
> > --
> > Ariel Fleslerhttp://flesler.blogspot.com