小编asd*_*asd的帖子

当我击中拇指不完全位于中心时,使输入范围不跳跃

下面是范围类型的 HTML 输入。我把它做得更大,以便更明显。当我将鼠标放在红色拇指上并移到一边时,如果我没有完全位于拇指中心,它会跳跃,以便鼠标光标位于拇指中心,然后它会正常移动。

是否有可能改变它,以便在第一次移动时没有第一次突然跳跃?

input[type=range] {
  -webkit-appearance: none;
  pointer-events: none;
  background-color: green;
} 
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1cm;
  height: 1cm;
  background-color: red;
  cursor: pointer;
  pointer-events: auto !important;
}
Run Code Online (Sandbox Code Playgroud)
<input type="range">   
Run Code Online (Sandbox Code Playgroud)

html javascript css

10
推荐指数
1
解决办法
422
查看次数

即使只有单个固定元素,chrome应用程序滚动也不起作用

我有以下Chrome应用。运行它时,显示主窗口,但鼠标滚轮不起作用。当我在Chrome中打开main.html时,滚动效果很好。如何解决?

manifest.json:

{
  "name": "Scroll not working",
  "version": "1.0",
  "manifest_version": 2,
  "description": "Scrolling in this chrome app is not working",
  "app": {
    "background": {
      "scripts": ["background.js"]
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

background.js:

// Background script (displays main window)
'use strict';
chrome.app.runtime.onLaunched.addListener(function () {
    chrome.app.window.create('main.html');
});
Run Code Online (Sandbox Code Playgroud)

main.html:

{
  "name": "Scroll not working",
  "version": "1.0",
  "manifest_version": 2,
  "description": "Scrolling in this chrome app is not working",
  "app": {
    "background": {
      "scripts": ["background.js"]
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

html javascript scroll google-chrome google-chrome-app

1
推荐指数
1
解决办法
769
查看次数