【问题标题】:Stop dragscroll.js while using range sliders使用范围滑块时停止 dragscroll.js
【发布时间】:2019-12-02 04:53:15
【问题描述】:
我与dragscroll 合作。在可拖动区域中会有几个范围滑块。目前,无法使用此滑块,因为拖动滚动会移动该区域。
是否可以在使用范围滑块时暂停拖动滚动?
我开始写这个,但目前它根本不起作用:
$( "input[type=range]" ).hover(function() {
$('.dragscroll').removeClass('dragscroll');
});
希望有人可以帮助我。 :)
新闻:
我只是尝试删除其他类并且效果很好。为什么我不能删除 draggscroll 类?
【问题讨论】:
标签:
javascript
jquery
drag
rangeslider
【解决方案1】:
尝试使用这个补丁版本
https://github.com/ethaizone/dragscroll/tree/patch-2
.dragscroll {
width: 270px;
float: left;
padding: 10px;
overflow: auto;
}
<script src="https://rawcdn.githack.com/ethaizone/dragscroll/a0a014ef981ca8e04c207166be65142deffc9cf1/dragscroll.js" crossorigin="anonymous"></script>
<div class="dragscroll">
<h3>Event horizon</h3>
<pre>
In general relativity, an event horizon is a boundary in spacetime beyond which events cannot affect an outside observer. In layman's terms, it is defined as "the point of no return", i.e., the point at which the gravitational pull becomes so great as
to make escape impossible. An event horizon is most commonly associated with black holes. Light emitted from beyond the event horizon can never reach the outside observer. Likewise, any object approaching the horizon from the observer's side appears
to slow down and never quite pass through the horizon, with its image becoming more and more redshifted as time elapses. The traveling object, however, experiences no strange effects and does, in fact, pass through the horizon in a finite amount of
proper time.
</pre>
<div>
<input type="range" min="0" max="100" value="30" />
</div>
</div>
参考
https://github.com/asvd/dragscroll/issues/47