Scrollmagic: Changing duration of animation for different screen sizes

Created on 23 Jun 2014  路  4Comments  路  Source: janpaepke/ScrollMagic

Hi,

How do I change the duration of my animations for different browser sizes?

At the moment my durations are too fast on smaller browser sizes. I saw on the examples page there is some code for the duration to be updated depending on window size but I can't implement it.

I have created a http://jsfiddle.net/MFJ6n/ with my current code so you can see my layout and maybe point in the right direction as to where the duration code should be?

Many thanks

support

Most helpful comment

You can update your scroll scene this way. It works for me.

$(window).bind("resize", function() {
   yourScrollScene.duration(newDuration);
}

All 4 comments

You can update your scroll scene this way. It works for me.

$(window).bind("resize", function() {
   yourScrollScene.duration(newDuration);
}

Hi @neelamk,
did this answer your question?

Hi Guys,

I didn't need to do change the duration in the end because I managed to get the duration exactly as I wanted and it seemed to be working well on different browser sizes, so I haven't tried the code.

Out of curiosity though where abouts in my code would I place the code from iakgoog?

Many thanks for your help.

You could put it anywhere after defining your scene.
Glad you managed to sort it out. :-)

Was this page helpful?
0 / 5 - 0 ratings