1
203
要模拟元素顶部的第二个水平滚动条,请放置“dummy”
举个活生生的例子 见 this fiddle 下面是代码 : HTML:
CSS:
JS:
|
2
35
尝试使用
jQuery:
CSS
HTML
|
3
17
第一个伟大的答案是@stanleyh 如果有人想知道如何制作动态宽度的双滚动容器 CSS
JS
HTML
演示 |
4
10
|
5
9
无jquery(2017)因为您可能不需要jquery,下面是一个基于@stanleyh答案的普通JS版本:
|
6
3
基于@stanleyh解决方案,我创建了一个 AngularJS directive 演示 jsFiddle . 易于使用:
不需要jquery。 |
7
2
链接滚动条是有效的,但在书写的过程中,它会创建一个循环,在大多数浏览器中,如果您单击较轻滚动条的一部分并按住它(拖动滚动条时不这样做),滚动速度会变慢。 我用旗把它修好了:
|
8
1
据我所知,HTML和CSS不可能做到这一点。 |
9
1
扩展Stanleyh的答案,并尝试找到所需的最小值,以下是我实现的: javascript(从诸如$(document.ready()之类的地方调用一次):
HTML(请注意,宽度将更改滚动条长度):
就是这样。 |
10
1
在普通的javascript/angular中,您可以这样做:
HTML:
CSS:
|
11
0
如果您在WebKit浏览器或移动浏览器上使用iscroll.js,可以尝试:
|
12
-1
滚动方向有问题:rtl。插件似乎不支持它。这是小提琴:jsfiddle.net/qsn7tupc/3 请注意,它在Chrome中工作正常,但在所有其他流行的浏览器中,顶部的滚动条方向保持为左。 |
Softly · 单选按钮未按预期取值 1 年前 |
SlickRed · 我无法使用JS关注HTML元素 1 年前 |
assembler · Nextjs没有处理发布请求 1 年前 |
BADRUM · 执行两个获取功能后,如何导航回页面? 1 年前 |
Toniq · javascript为php保存多维数组 1 年前 |