最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

JS實(shí)現(xiàn)拖動(dòng)滾動(dòng)條評分的效果代碼分享

 更新時(shí)間:2016年09月29日 15:19:24   投稿:mrr  
本文給大家基于js實(shí)現(xiàn)拖動(dòng)滾動(dòng)條評分效果,在項(xiàng)目開發(fā)中經(jīng)常可以用到的,大家可以更加需要適當(dāng)?shù)奶砑有薷?,對js評分效果感興趣的朋友一起看看吧

小編教你JS特效拖動(dòng)滾動(dòng)條可以評分效果,小編感覺挺不錯(cuò),用時(shí)候可能需要ASP/PHP或其它語言配合取值并寫入數(shù)據(jù)庫,這是前臺的實(shí)現(xiàn)。

直接上代碼 看看JS的神奇吧!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>JS實(shí)現(xiàn)拖動(dòng)<a href="http://m.fzitv.net/zt/gundongtiao/" target="_blank" class="infotextkey">滾動(dòng)條</a>評分的特效 (m.fzitv.net)</title>
<style>
body{
margin:50px; ; 
}
.scale_panel{
font-size:12px;
color:#999;
width:200px;
position:absolute; 
<a href="http://m.fzitv.net/article/15092.html" target="_blank" class="infotextkey">line-height</a>:18px; 
left:60px;
top:-0px;
}
.scale_panel .r{
float:right;
}
.scale span{
width:8px;
height:16px; 
position:absolute; 
left:-2px;
top:-1px;
cursor:pointer;
}
.scale{
border-left:1px #83BBD9 solid;
border-right:1px red solid;
width:200px;
height:10px; 
position:relative; 
font-size:0px;
}
.scale div{
width:0px; 
position:absolute; 
width:0;
left:0;
height:5px;
bottom:0;
}
li{
font-size:12px;
line-height:50px;
position:relative; 
height:50px; 
list-style:none;
}
</style>
</head>
<body>
<ul>
<li>愛情 <span id="title">0</span>
<div class="scale_panel">
<span class="r">100</span>0
<div class="scale" id="bar">
<div></div>
<span id="btn"></span>
</div> 
</div> 
</li>
<li>事業(yè) <span id="title2">0</span>
<div class="scale_panel">
<span class="r">100</span>0
<div class="scale" id="bar2">
<div></div>
<span id="btn2"></span>
</div> 
</div> 
</li>
<li>家庭 <span id="title3">0</span>
<div class="scale_panel">
<span class="r">100</span>0
<div class="scale" id="bar3">
<div></div>
<span id="btn3"></span>
</div> 
</div> 
</li>
</ul>
</body>
<script>
scale=function (btn,bar,title){
this.btn=document.getElementById(btn);
this.bar=document.getElementById(bar);
this.title=document.getElementById(title);
this.step=this.bar.getElementsByTagName("DIV")[0];
this.init();
};
scale.prototype={
init:function (){
var f=this,g=document,b=window,m=Math;
f.btn.onmou<a href="http://m.fzitv.net/article/1141.html" target="_blank" class="infotextkey">sed</a>own=function (e){
var x=(e||b.event).clientX;
var l=this.offsetLeft;
var max=f.bar.offsetWidth-this.offsetWidth;
g.onmousemove=function (e){
var thisX=(e||b.event).clientX;
var to=m.min(max,m.max(-2,l+(thisX-x)));
f.btn.style.left=to+'px';
f.ondrag(m.round(m.max(0,to/max)*100),to);
b.getSelection ? b.getSelection().removeAllRanges() : g.selection.empty();
};
g.onmouseup=new Function('this.onmousemove=null');
};
},
ondrag:function (pos,x){
this.step.style.width=Math.max(0,x)+'px';
this.title.innerHTML=pos+'%';
}
}
new scale('btn','bar','title');
new scale('btn2','bar2','title2');
new scale('btn3','bar3','title3');
</script>
<br />
</html>

以上所述是小編給大家介紹的JS實(shí)現(xiàn)拖動(dòng)滾動(dòng)條評分的效果代碼分享,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時(shí)回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評論

广丰县| 石家庄市| 深泽县| 怀来县| 额敏县| 永修县| 依兰县| 昌邑市| 盐津县| 梁河县| 宁夏| 德州市| 册亨县| 博白县| 嘉义市| 丁青县| 东乌珠穆沁旗| 襄垣县| 威宁| 三原县| 茶陵县| 灵璧县| 同江市| 黄龙县| 湖南省| 灵寿县| 鱼台县| 家居| 广州市| 翁牛特旗| 盐津县| 井陉县| 宜黄县| 马龙县| 牡丹江市| 象州县| 定西市| 六安市| 潼关县| 浪卡子县| 沂水县|