Scrollview无法在y轴上运行(Scrollview isn't working in y

系统教程 行业动态 更新时间:2024-06-14 17:01:34
Scrollview无法在y轴上运行(Scrollview isn't working in y-axis)

这个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.

更多推荐

本文发布于:2023-04-20 18:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/85a0aebeb2516905029062ef8b2c88a9.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Scrollview   working

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!