How do I scroll a column at a different speed?

I have two columns, #photos and #text. My #photos column is longer and logically holds some images. When I scroll the page, I like the #photos column to scroll faster than the #text column, so that both columns align at the bottom.

I use jQuery’s $ (window).scroll() to update the #photos column:

$  ("#photos").css("top", Math.round(targetY));

How do I calculate targetY?

I know it probably has something to do with $ (document).height(), $ (“#photos”).height() and $ (window).scrollTop(), but I can’t figure out the formula.

newest questions tagged jquery – Stack Overflow

About Admin