johnpolacek / superscrollorama

The original jQuery plugin for supercool scroll animation. NOTE: No longer under active development. New version is ScrollMagic.js
http://johnpolacek.github.com/superscrollorama/
2.39k stars 539 forks source link

Can I center my div in the window ? #43

Closed kahla closed 11 years ago

kahla commented 11 years ago

Hello !

I'm french (so sorry for my poor english) and new in the world of Jquery, but I began to understand. Superscrollorama is just beautiful, I actually managed to do 90% of what I was hoping. the last 10% is for my question: How do I center in the window my div who move in my page? My div follows well defined path by the tween but it quickly disappears from my screen, I would like the div stays centered.

Please help me :-)

janpaepke commented 11 years ago

Hi Kahla and welcome to the wonderful world of jQuery. Please set up a demo page and send us the link so we can see your project.

regards, Jan

kahla commented 11 years ago

Thank you for responding quickly !

For the moment it is only a test for a future project. So the images are ugly, if you please be kind. So my little rectangle should follow my pink path, it works here... but the scroll speed is too fast compared to my rectangle, suddenly, the rectangle disappears of the window. I would like my rectangle is always visible in the window.

http://mesessais.vv.si/

janpaepke commented 11 years ago

Hi kahla,

sorry for the late reply, i was quite busy. I think the error might be in line 50. You are supposed to pass a reference object that is supposed to be pinned to the method. Instead you pass $(). Put the animation you want to do in a wrapper and then pin this wrapper by passing it to the function. Please read the documentation carefully for further details.

regards, Jan