7

I have the following to display a list of items and a button underneath the list. However the button is overlapping on top of the list. I must be not putting some kind of data-role or another one of their attributes on it.

<div data-role="content" data-theme="b">    
    <div>
       <ul id="listOfSheets" data-role="listview" >
     <li class="hidden"> <a href="_linkToSheet" data-ajax="false"> _sheetName</a></li>
      </ul>
    </div>  
    <input id="logout" type="button" value="Sign Out"    />
 </div><!-- /content -->

Here is what it looks like:

enter image description here

4 Answers 4

7

Live Example:

You're missing one of the attributes for the listview

data-inset="true"

HTML

<div data-role="content" data-theme="b">    
    <div>
        <ul id="listOfSheets" data-role="listview" data-inset="true">
            <li class="hidden"><a href="#" data-ajax="false">Link 1</a></li>
            <li class="hidden"><a href="#" data-ajax="false">Link 2</a></li>
            <li class="hidden"><a href="#" data-ajax="false">Link 3</a></li>
        </ul>
    </div>  
    <input id="logout" type="button" value="Sign Out" />
</div><!-- /content -->
Sign up to request clarification or add additional context in comments.

2 Comments

Yup this works. Link for reference jquerymobile.com/test/docs/lists/docs-lists.html
But this changes the styling of the list: adds borders and margins on all sides.
1

i experienced the same problem. Here is my fix.

 <style>
 .ui-content .ui-listview
    {
        margin-top: 5px;
        margin-bottom: 5px;
    } 
</style>

JsFiddle Demo

You dont need to modify your markups.

Comments

0

How about inserting an line break befor the button.Not a clean solution I think.But it will work.

<div data-role="content" data-theme="b">    
    <div>
       <ul id="listOfSheets" data-role="listview" >
     <li class="hidden"> <a href="_linkToSheet" data-ajax="false"> _sheetName</a></li>
      </ul>
    </div> 
    <br>
    <input id="logout" type="button" value="Sign Out"    />
 </div><!-- /content -->

1 Comment

Nope. Inserting a break does not fix it.
0

I used padding to solve this kind of problems. See below I added padding to the list-container div.

<div data-role="content" data-theme="b">    
  <div style="padding-bottom:20px">
    <ul id="listOfSheets" data-role="listview" >
        <li class="hidden"><a href="#" data-ajax="false">Link 1</a></li>
        <li class="hidden"><a href="#" data-ajax="false">Link 2</a></li>
        <li class="hidden"><a href="#" data-ajax="false">Link 3</a></li>
    </ul>
  </div>  
<input id="logout" type="button" value="Sign Out"    />

​​​

Here is a DEMO

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.