这个jQuery插件不适用于y轴。
http://jsfiddle.net/weissraum/tsyzZ/
怎么解决这个问题?
你不能删除jsfiddle中的doctype声明,但我在x和y轴上都成功地进行了本地成功。
This jQuery plugin doesn't work with the y-axis.
http://jsfiddle.net/weissraum/tsyzZ/
How can this be solved?
You cannot delete doctype declaration in jsfiddle, but I did successfully locally on both x & y axis.
最满意答案
您需要设置CSS,以便#container元素的大小是视口大小的100%,而不是文档大小的100%。
将其添加到#container CSS规则:
position : absolute; top : 0; left : 0;这就是问题所在,问题是#container元素没有任何垂直滚动条,因为它是完整的文档高度。
这是一个演示: http : //jsfiddle.net/tsyzZ/3/
此外,如果您更改overflow:auto to overflow:hidden对于#container元素overflow:hidden ,滚动条将消失,但用户仍然可以使用scrollview插件来平移元素。
You need to setup your CSS so that the #container element is 100% of the size of the view-port, not 100% of the size of the document.
Add this to the #container CSS rule:
position : absolute; top : 0; left : 0;That's all, the issue was that the #container element didn't have any vertical scrollbars since it was full document height.
Here is a demo: http://jsfiddle.net/tsyzZ/3/
Also, if you change overflow:auto to overflow:hidden for the #container element the scrollbars will disappear but the user can still use the scrollview plugin to pan the element.
更多推荐
发布评论