문제

jQuery sliding animations are choppy unlike scriptaculous ones. So i want to replace my jQuery .slideUp/Down() with Scritaculous

Basically, use scriptaculous slideup/down in this code ->

jQuery('.button').on('click', function(){
jQuery('#box').slideUp();
});

Is it possible? if yes, what would be correct way to use sciptaculous slide in the code above?

note: i already have prototype.js included in the page and i DON't want to rewrite all my jquery code to prototype

도움이 되었습니까?

해결책

You want to use the BlindUp method

and I would suggest attaching the event using prototypejs if you want to use scriptaculous on an element - you don't have to though.

Based on your example jquery code you are attaching to the click event for all of the .button class elements - equivalent code below.

$$(".button").invoke("observe","click",function(){
    $("box").blindUp()
});

http://madrobby.github.com/scriptaculous/effect-blindup/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top