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