jquery更改div类的样式属性
我有这样的滑块类,我想改变样式属性style =“left:336px”
<div id="range-cont"> <div class="slider"> <div class="progress" style="width: 350px;"></div> <a class="handle" href="#" **style="left: 336px;"**></a> </div> <input id="percentage" class="range" type="range" value="14" name="percentage" min="0" max="100"> <p id="percent-label">%</p> </div> </div>  我试过$('.handle').css({'style':'left: 300px'})但它不工作。 不知道我在这里做错了什么 
 试试$('.handle').css('left', '300px'); 
如果你只是想设置style属性使用
 $('.handle').attr('style','left: 300px'); 
或者你可以使用jQuery的CSS方法来设置只有一个CSS样式属性
 $('.handle').css('left', '300px'); 
或者与键值相同
 $('.handle').css({'left': '300px', position}); 
更多关于W3schools的信息
尝试
 $('.handle').css({'left': '300px'}); 
代替
 $('.handle').css({'style':'left: 300px'}) 
 $('.handle').css('left', '300px'); $('.handle').css({ left : '300px' }); $('.handle').attr('style', 'left : 300px'); 
或使用OrnaJS
这对你有帮助..
 $('.handle').css('left', '300px'); 
 样式是一个属性,所以css不会为它工作.U可以使用attr 
更改:
 $('.handle').css({'style':'left: 300px'}); 
T0:
 $('.handle').attr('style','left: 300px');//Use `,` Comma instead of `:` colon