【发布时间】:2016-04-10 00:00:56
【问题描述】:
我尝试创建input ranger 以在 div 中应用对比度过滤器:
https://jsfiddle.net/ckekj8dn/
但它不起作用
感谢您的帮助
$('#contrast').on('input', function() {
$('#mydiv').css('contrast', $(this).val() + "%");
});
#mydiv {
width: 400px;
height: 400px;
background-image: url("http://www.lorempixel.com/200/200/");
background-size: 100%;
border: solid 1px black;
background-repeat: no-repeat;
}
<div id="mydiv"></div>
Contrast
<input id="contrast" type="range" value="opacity_fundo" max="1" min="0" step="0.01" />
<br>
【问题讨论】: