画像スライダーを設定して機能させています。今必要なのは、スライダー内の要素の位置に基づいて画像を表示または非表示にすることです。
ファイアバグを見ると、次のことがわかります(liアイテムがいくつかあり、ここに1つだけ表示していることに注意してください)。
<li class="roundabout-moveable-item" style="position: absolute; left: 128px; top: 104px; width: 185.9px; height: 188.1px; opacity: 1; z-index: 145; font-size: 8.3px;">
その「左」の位置に応じて、次のようなことができるようにしたいと思います。
if left > 400px then add a class which will show image one,
if left < 300px then add a class which will show image two,
if left >= 300px and <= 400px then add a class which will show no image
すべての助けは大歓迎です。私はJQueryにかなり慣れていませんが、これまでのところ、次のことを考えています。
var left = $("li.roundabout-moveable-item").position.left;
$("li.roundabout-moveable-item").addClass("no-image");
if(left < 300px) {
$('li.roundabout-moveable-item").addClass("image-one");
}
elseif(left > 400px) {
$('li.roundabout-moveable-item").addClass("image-one");
}
else {
$('li.roundabout-moveable-item").addClass("no-image");
}
ありがとう