如果你看一下这个:
https://jsfiddle.net/h8kmove5/27/
假设您单击底部的 9。它显示 8 9 10。我只是想在 9 的左侧和右侧添加一点额外的空间。或任何其他与此相关的事件元素。例如,8 的右半部分和 10 的左半部分是可见的吗?
#sync1 .synced .item {
margin-left: 50px;
margin-right: 50px;
}
最佳答案
我尝试了一些东西。就像您为“#sync2”添加类“synced”一样,我也为“#sync1”添加了相同的类。
var current = this.currentItem;
console.log(current)
$("#sync1")
.find(".owl-item")
.removeClass("synced")
.eq(current+1)
.addClass("synced")
并为该同步元素添加了边距。
#sync1 .synced{margin:0 10px 0 10px;}
检查fiddle这里
关于javascript - 在事件元素周围添加额外空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34992047/