문제

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