简体   繁体   English

jQuery .slider()无法正常工作

[英]jQuery .slider() not working

I've been working with the jQuery .slider() on my webpage for a while now, but suddenly when I'm running it locally, the slider shows up like this when I initate it in the html, and nothing can be done with it (it looks like its at value 0, and you can't interract with it): 我已经在我的网页上使用jQuery .slider()了一段时间,但是突然间,当我在本地运行它时,当我在html中初始化它时,滑块就会像这样显示,并且无法执行任何操作它(看起来像它的值为0,并且您不能与它进行交互):

<div id="volume" style="touch-action: pan-y; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
<ul class="indicators"></ul><ul class="indicators"></ul>
</div>

I'm initiating it with this code, it has worked before with the exact same code: 我正在用此代码启动它,它之前已经使用完全相同的代码工作过:

$("#volume").slider({
    min: 0,
    max: 100,
    value: 50,
    range: "min",
    animate: true,
    slide: function(event, ui) {
      setVolume(ui.value);
    }
});

It happened after I started using materializecss and socket.io on my webpage. 这是在我开始在网页上使用materializecss和socket.io之后发生的。

Anyone know how to fix this, and get it back to being operational again? 任何人都知道如何解决此问题,并使它重新恢复正常运行吗?

Found out MaterializeCSS also has a function called slider in their JavaScript. 事实证明,MaterializeCSS在其JavaScript中也有一个称为Slider的函数。 Had to remove that from their code, and the slider works as it was again. 不得不将其从其代码中删除,并且滑块再次正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM