我正在寻找可以垂直和水平滚动的滑块。我希望在其他区域滑动箭头。这有可能,如果是这样的话怎么样? 我有一张照片:
答案 0 :(得分:0)
试试这个:
<button id="left">◄</button>
<button id="bottom">▼</button>
<button id="right">►</button>
<div class="block"></div>
div {
position:absolute;
background-color:#000;
left:50px;
width:90px;
height:90px;
margin:5px;
top:50px;
}
var slideDistance;
var slideSpeed;
//Change this Properties
slideDistance = 200;
slideSpeed = 500;
$("#right").click(function(){
$(".block").animate({"left": "+=" + slideDistance + "px"}, slideSpeed);
});
$("#left").click(function(){
$(".block").animate({"left": "-=" + slideDistance + "px"}, slideSpeed);
});
$("#bottom").click(function(){
$(".block").animate({"top": "+=" + slideDistance + "px"}, slideSpeed);
});