animate 関数の代わりに scrollTo() 関数を使用できますか?
アニメーション機能を使用していますが、アニメーション機能を使用せずに同じ機能を実行したいのですが、scrollTo機能を使用できますか?
$("#new_div").on("click", ".ui-keyboard-has-focus .keyboard_arrow_container li", function (event) {
//.scroll_bottom_arrow
switch ($(this).index()) {
case 0:
{
$(".wrapper_div_id").animate({
scrollLeft: "-=" + 500 + "px"
});
break;
}
case 1:
{
$(".wrapper_div_id").animate({
scrollLeft: "+=" + 500 + "px"
});
break;
}
case 2:
{
$(".wrapper_div_id").animate({
scrollTop: "-=" + 300 + "px"
});
break;
}
case 3:
{
$(".wrapper_div_id").animate({
scrollTop: "+=" + 300 + "px"
});
break;
}
}
// event.preventDefault();
});