سؤال

This is my code:

$$('.container ul')[0].setStyle({
  top: '20px'
});

Is there a way to animate that code in Prototype?

Thanks!

هل كانت مفيدة؟

المحلول

If you add script.aculo.us to your page that will provide the animation you are looking for.

try using the morph() method which will tween between your current style and the style you pass

$$('.container ul')[0].morph({
  top: '20px'
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top