Search code examples
htmljquery-mobile-listviewjquery-mobile-collapsible

Remove the border of collapsible div within listview


I have a problem of removing the border of a collapsible div within a li tag. The demo is shown in http://jsfiddle.net/lightbringer/FsSmy/

<ul id="userstorylist" data-role="listview" data-filter="true">
    <li id="draggable">
        <div data-role="collapsible" data-theme="b" data-content-theme="d">
            <h3>Userstory 1</h3>
            <p>Content</p>
        </div>
    </li>
    <li id="draggable">
        <div data-role="collapsible" data-theme="b" data-content-theme="d">
            <h3>Userstory 2</h3>
            <p>Content</p>
        </div>
    </li>
</ul>

Could anyone show me how to remove the border, I would like the items to stick together like normal listview.

Thanks in advance.


Solution

  • I have found a solution myself.

    <ul data-role="listview" data-filter="true">
        <li class="custom-li">
            <div class="custom-collapsible" data-name="1" data-role="collapsible" data-theme="b" data-content-theme="d" data-corners="false">
                <h3>Userstory 1</h3>
                <p>Content</p>
            </div>
        </li>
        <li class="custom-li">
            <div class="custom-collapsible" data-name="2" data-role="collapsible" data-theme="b" data-content-theme="d" data-corners="false">
                <h3>Userstory 2</h3>
                <p>Content</p>
            </div>
        </li>
    </ul>
    

    with css styling:

    .custom-li {
            padding: 0 !important;
            border-width: 0 !important;
    }
    
    .custom-collapsible {
        margin: 0 !important;   
        border-bottom-right-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
        border-width:0 !important;
    }
    

    This is the demo: http://jsfiddle.net/lightbringer/jWaEv/