gpt4 book ai didi

Javascript 库 SLY - 滚动条不起作用

转载 作者:行者123 更新时间:2023-11-30 18:02:46 25 4
gpt4 key购买 nike

我在使用 Sly 滚动条时遇到问题。

我想设置一个时间线,我可以在其中通过使用鼠标和滚动条拖动来滚动。用鼠标滚动效果很好,但我无法让滚动条工作,而且没有适当的文档。

控制台也没有错误。

这是我的滚动条:

<div id="scrollbar">
<div class="handle"></div>
</div>

这是CSS:

#scrollbar {
width: 100%;
height: 30px;
background: #f00;
margin-top: 10px;
line-height: 0;
}
#scrollbar .handle {
width: 50px;
height: 30px;
background: #00f;
position: absolute;
}

和启动滚动的 javascript 调用

$("#timeline").sly({
dragSource : '.frame',
horizontal : 1,
itemNav: 'basic',
smart : 1,
activateOn : 'click',
mouseDragging : 1,
touchDragging : 1,
releaseSwing : 1,
scrollBy : 1,
activatePageOn : 'click',
speed : 50,
easing : 'easeInOutBounce',
swingSpeed : 0.07,
elasticBounds : 1,
dragHandle : 1,
dynamicHandle : 1,
clickBar : 1,
scrollbar : '$("#scrollbar")',
dragHandle : 1
});

我的大学项目需要这个,所以如果有人能解决我的问题,那就太好了。

最佳答案

有两个小错误。

换行

滚动条:'$("#scrollbar")'

滚动条:$("#scrollbar")

一切都应该按预期工作。

关于Javascript 库 SLY - 滚动条不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16508549/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com