jQuery Mobile:制作可折叠元素 100% 宽度/不插入

发布于 2024-12-19 00:07:17 字数 109 浏览 2 评论 0原文

有没有办法使 jQuery Mobile 中的可折叠元素/集不插入?默认情况下,它使可折叠元素作为插入项。

data-inset="false" 不会改变行为。

Is there a way to make a collapsible element/set in jQuery Mobile not inset? By default it makes the collapsible element as an inset item.

data-inset="false" does not alter the behavior.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

來不及說愛妳 2024-12-26 00:07:17

如果为 margin-leftmargin-right 属性指定负值,则可以将可折叠内容扩展到页面的宽度。

可折叠元素的默认 margin-topmargin-bottom 值为 8px,因此我们可以为此编写一个 CSS 规则:

.ui-collapsible {
    margin : 8px -15px;
}

我选择了 >-15px 因为这是 data-role="content" 元素添加到每个页面的负 padding 量。

这是一个 jsfiddle 来查看它的作用: http://jsfiddle.net/jasper/zSvqU/

If you give the margin-left and margin-right properties a negative value you can expand the collapsible content to the width of the page.

The default margin-top and margin-bottom values for a collapsible are 8px so we can write a CSS rule for this:

.ui-collapsible {
    margin : 8px -15px;
}

I chose -15px because that is the negative amount of padding that the data-role="content" element adds to each page.

Here is a jsfiddle to view what this does: http://jsfiddle.net/jasper/zSvqU/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文