问题描述
我制作了此范围滑块。滑块根据需要移动。在这种情况下,如何获取切换位置的值?
例如,当切换开关位于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>
解决方法
在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