views:

53

answers:

2

Would you be able to animate a person jumping from the bottom of the screen to the top of the screen and have the scroll bar follow the person jumping? I'm pretty sure that's not possible, but I've been wrong before.

Here's a link to a pdf of what I'm describing.

http://docs.google.com/fileview?id=0B-nXtGvomnuqNzE4MjdjMWMtNzA5NC00NGZiLTg2YmItNjJmNGY0YjQ5MTM0&hl=en&authkey=CO_RnYAG

+1  A: 

Well of course this is possible, how much of this should/can be done in jQuery is another story, anyway here's what you could do:

  • Create several PNG images with the person in various animated position.
  • Preload these images.
  • Use document.body.scrollTop to scroll the document.
  • Use jQuery's animate() or similar to move the dude using some kind of elastic easing, not sure exactly which one fits best.

Not sure how good/smooth this would be though.

thomask
I don't think document.body.scrollTop is what we are looking for...Wouldn't that outpace the jumper? I think it would make more sense to have some kind of scrollTo that is set to something like 50px higher than the top of his head and that would follow him. Is this possible? Let me know what you think.
Maletor
A: 

A nice example:

http://www.dontcodetired.com/live//jQueryLiveExamples/bouncingball.htm

Almost looks like jumping but then upside down. It should give you a headstart though.

Deefjuh