带有颜色标记的自定义范围滑块,用于范围值

问题描述

我制作了此范围滑块。滑块根据需要移动。在这种情况下,如何获取切换位置的值?

例如,当切换开关位于1范围内时,div应当为“所选值:1”,依此类推。

$("#slider").slider({
  value: 50
})
#green {
  background: green;
  width: 100%;
  /* margin-left: 100px; */
  height: 14px;
}

#blue {
  background: blue;
  width: 100%;
  /* margin-left: 100px; */
  height: 14px;
}

#pink {
  background: pink;
  width: 40%;
  /* margin-left: 100px; */
  height: 14px;
}

#yellow {
  background: yellow;
  width: 100%;
  /* margin-left: 100px; */
  height: 14px;
}

#slider {
  background: red;
  display: flex;
}
<script type="text/javascript"src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/base/jquery-ui.css">
<div id="slider">
  <div id="green" class="ui-corner-all">1</div>
  <div id="blue" class="ui-corner-all">2</div>
  <div id="yellow" class="ui-corner-all">3</div>
  <div id="pink" class="ui-corner-all">4</div>
</div>

jsFiddle Code

解决方法

API documentation中,您可以找到

text=['dear pados wali anttty,can  just keep your thoughts and nose out  business raising_hands  thaaaank .','but  least  did not call him losers  suckers,juuust was did not want   the cemetery and honor them,big deal.','some hunters are just entitled,you are lucky  have them.','thin corrrect time that.. only one person could save  from this crisis  ..   correct sarthak ? ?','thereee  also the wuhan virus.   that totally different ?','does nooot every woman hav  adam apple amp;  flat hairy chest ?']
import pandas as pd
df=pd.DataFrame()
df['Text']=text

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...