jQuery Mobile:制作可折叠元素 100% 宽度/不插入
有没有办法使 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果为
margin-left
和margin-right
属性指定负值,则可以将可折叠内容扩展到页面的宽度。可折叠元素的默认
margin-top
和margin-bottom
值为8px
,因此我们可以为此编写一个 CSS 规则:我选择了
>-15px
因为这是data-role="content"
元素添加到每个页面的负padding
量。这是一个 jsfiddle 来查看它的作用: http://jsfiddle.net/jasper/zSvqU/
If you give the
margin-left
andmargin-right
properties a negative value you can expand the collapsible content to the width of the page.The default
margin-top
andmargin-bottom
values for a collapsible are8px
so we can write a CSS rule for this:I chose
-15px
because that is the negative amount ofpadding
that thedata-role="content"
element adds to each page.Here is a jsfiddle to view what this does: http://jsfiddle.net/jasper/zSvqU/