Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Mobile: make a collapsible element 100% width/NOT inset

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.

like image 238
cjcee Avatar asked Dec 02 '11 14:12

cjcee


1 Answers

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/

like image 102
Jasper Avatar answered Oct 18 '22 11:10

Jasper