您好我試圖使按向上和向下箭頭,我想這代碼這個滑塊移動,但它不能正常如何通過按上,使滑塊移動和向下箭頭
工作的jsfiddle Here
$("body").keydown(function(e) {
if(e.keyCode == 38) { // top
$(".swiper-slide").animate({
top: "-=518"
});
}
else if(e.keyCode == 40) { // bottom
$(".swiper-slide").animate({
bottom: "+=518"
});
}
});
分享的HTML代碼請 – Michael
嗨@邁克爾看看Jsfiddle –
@babuharry請在問題本身發佈完整的代碼。問題需要自我包含,就像外部鏈接失敗一樣,問題將失去其上下文。 –