0
我試圖沒有成功禁用HTML5日期輸入上的滾動。
此輸入有一個webshim回退,這導致我的JS與Chrome,但不是Firefox。Firefox:禁用HTML5日期輸入上的滾動具有webshim後備
$('.input-date input').on('mousewheel', function (event) {
event.preventDefault();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/webshim/1.15.6/dev/polyfiller.js"></script>
<script type="text/javascript">
webshims.cfg.no$Switch = true;
webshim.setOptions({
'forms-ext': {
widgets: {
calculateWidth: false
}
}
});
webshim.polyfill('forms forms-ext');
</script>
<form>
<div class="input-date">
<input type="date" value="2015-02-24">
</div>
</form>
有誰曾經面臨過這樣的問題?