2014-03-05 55 views

回答

1

请检查答案。它为我工作很好。希望它对你有帮助。

HTML:

<div class="form-range-control"><input type="range" max="100" min="10" value="100" step="1"></div> 

CSS:

.form-range-control { 
    margin: 0 auto; 
    background-color: #afe0fc; 
    padding: 1.5em; 
    border-radius: 5px; 
} 
.form-range-control input[type="range"] { 
    -webkit-appearance: none; 
    background-color: white; 
    height: 3px; 
    border-radius: 1px;width:100%; 
} 
.form-range-control input[type="range"]::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    width: 20px; 
    height: 20px; 
    background: #078dd8; 
    border-radius: 50%; 
    cursor: -moz-grab; 
    cursor: -webkit-grab; 
} 

Demo

+0

谢谢,这似乎工作。 http://m.dabase.com/r2/但是,你可以把它归结为实际上将滑块更改为那个圆形轨道吗? – hendry

+0

@hendry,你需要添加css类.form-range-control input [type =“range”] :: - webkit-slider-thumb对于round orb。因此,将这些css类添加到您的m.dabase.com/r2。希望它能工作。请尝试让我知道。谢谢 – Jeba

+0

奇数,如何.form-range-control input [type =“range”] {-webkit-appearance:none; }似乎很重要。 – hendry

0

这里是plunker

http://plnkr.co/edit/TUx6xNA1dv3OJowBEDQj?p=preview

CSS:

.tour-sidebar { 
-webkit-font-smoothing: antialiased; 
box-sizing: border-box; 
color: rgb(51, 51, 51); 
display: block; 
font-family: 'Gotham SSm A', 'Gotham SSm B', 'Helvetica Neue', Helvetica, Arial, sans-serif; 
font-size: 13px; 
height: 77px; 
line-height: 18.571409225463867px; 
margin-top: 54.599998474121094px; 
width: 222.5px; 

} 





.form-range-control { 
    width: 100%; 
    margin: 0 auto; 
    background-color: #afe0fc; 
    padding: 1.5em; 
    border-radius: 5px; } 
    .form-range-control input[type="range"] { 
    -webkit-appearance: none; 
    background-color: white; 
    height: 3px; 
    border-radius: 1px; } 
    .form-range-control input[type="range"]:focus { 
     outline: none; } 
    .form-range-control input[type="range"]::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    width: 20px; 
    height: 20px; 
    background: #078dd8; 
    border-radius: 50%; 
    cursor: -moz-grab; 
    cursor: -webkit-grab; } 
    .form-range-control input[type="range"]::-webkit-slider-thumb:active, .form-range-control input[type="range"]::-webkit-slider-thumb:focus { 
     background: #056da7; 
     cursor: -moz-grabbing; 
     cursor: -webkit-grabbing; }