[英]Image slider not sliding after clicking the right arrow
這個問題似乎很奇怪,我檢查了我的代碼的替換,但所有這些都給出了同樣的問題。 一個替換可以是Jquery:mousedown效果(按住左鍵單擊) 。 我正在嘗試制作一個滑塊,將圖像的拇指向右或向左滑動。 然后,人們可以從拇指中選擇並單擊他想要的圖像並顯示它。拇指可以向右和向左滑動。 問題是,點擊右鍵后圖像不會再向左滑動,我認為這是一個有明確間隔的東西。 這是小提琴, http://jsfiddle.net/2rfm5/18/點擊右箭頭后左側滑動效果不起作用。
$("#popUpInnerArrowLeft").mousedown(function(event) {
movetoleft();
});
var into ,into2 ;
function movetoleft() {
function moveit() {
$(".thumbsInnerContainer").animate({right:'+=10px'});
}
into = setInterval(function() { moveit(); }, 500);
}
$(document).mouseup(function(event) {
clearInterval(into);
});
//for the right arrow
$("#popUpInnerArrowRight").mousedown(function(event) {
movetoright();
});
function movetoright() {
function moveit2() {
$(".thumbsInnerContainer").animate({left:'+=10px'});
}
into2 = setInterval(function() { moveit2(); }, 500);
}
$(document).mouseup(function(event) {
clearInterval(into2);
});
問題是使用$(document).mouseup()
你應該做的事情如下:
$('#popUpInnerArrowRight, #popUpInnerArrowLeft ').mouseup(function(){
clearInterval(stillDown);
});
查看小提琴,了解如何執行此操作的完整示例。
這對我有用 , http://jsfiddle.net/2rfm5/19/
而我只是改變了,
$(".thumbsInnerContainer").animate({
right: '+=10px'
});
至
$(".thumbsInnerContainer").animate({
left: '+=10px'
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.