これはdivsliderの例のリンクです:http://jsfiddle.net/jtbowden/ykbgT/light/
しかし、この例では、divは右から左に移動しています
しかし、私は今、divを左から右に移動したいと思います。このウェブサイトにはすでにエディターがあります。だから私がdivを逆方向に動かすのを手伝ってください。私のコードでは両側に行きたいので
$('.box').click(function() {
$('.box').each(function() {
if ($(this).offset().left < 0) {
$(this).css("left", "150%");
} else if ($(this).offset().left > $('#container').width()) {
$(this).animate({
left: '50%',
}, 500 );
} else {
$(this).animate({
left: '-150%',
}, 500 );
}
});
});