Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems while using icon only with no text in a navbar in jquery mobile footer

This is the code i am using:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta name="viewport" content="width=device-width; initial-scale=1.0" />
        <link rel="stylesheet"  href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" /> 
        <script src="http://code.jquery.com/jquery-1.6.1.min.js"></script> 
        <script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
    </head>
    <body>
    <div data-role="page" id="home">
            <div data-role="header" data-theme="b">
                <h1>Home</h1>
            </div>
            <div data-role="content" data-theme="b">
            </div>
             <div data-role="footer" data-position="fixed" data-id="pFooter">
                <div data-role="navbar">
                    <ul>
                        <li><a href="#" data-icon="custom" class="ui-btn-active" >Home</a></li>
                        <li><a href="#first" data-icon="grid">Page1</a></li>
                        <li><a href="#" data-icon="star">Page2</a></li>
                        <li><a href="#" data-icon="arrow-r" data-iconpos="notext"></a></li>
                    </ul>
                </div>
        </div>  
    </div>
    </body>
</html>

You can see it in action here- http://jsfiddle.net/PJWQr/

The problem I am facing is that in the last button where I am using data-iconpos="notext",the height of the interactive area is lesser than other buttons in the navbar.

Kindly let me know how to fix this.

like image 556
user700284 Avatar asked Dec 12 '22 11:12

user700284


2 Answers

You actually don't need the iconpos="notext" as it is not technically a button.

Remove that attribute and add a space character to the content of the a element:

<li><a href="#" data-icon="arrow-r">&nbsp;</a></li>
like image 54
Simon Hartcher Avatar answered Dec 15 '22 00:12

Simon Hartcher


Probably the easy (kind of quick and dirty, but I'm heading to bed so this is what you get ;) is to just but a character there: http://jsfiddle.net/PJWQr/2/

like image 45
kinakuta Avatar answered Dec 15 '22 01:12

kinakuta