2

I'm using jQuery Mobile layout grids with 2 columns but there's a space gap when the cell's height is different.

Example:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>jQueryMobile Demos</title>                         
        <link type="text/css" rel="stylesheet" href="jquery.mobile-1.0a4.min.css" />
        <script type="text/javascript" src="jquery-1.5.2.min.js"></script>
        <script type="text/javascript" src="jquery.mobile-1.0a4.min.js"></script>            
    </head>
    <body>        
        <div data-role="page">
            <div data-role="content">
                <div class="ui-grid-a">
                    <div class="ui-block-a"><div class="ui-bar ui-bar-c">Name</div></div>
                    <div class="ui-block-b"><div class="ui-bar ui-bar-c">Diogo<br />Cardoso</div></div>             
                </div>
            </div>
        </div>  
    </body>

4

1 回答 1

2

在文档中(在示例中),他们使用内联样式标签来表示高度。文档:http: //jquerymobile.com/demos/1.0a4.1/docs/content/content-grids.html

内联样式标签:style="height:120px"

这是一个工作示例:http: //jsfiddle.net/V4uqN/5/

http://api.jquery.com/css/

就像是:

$('#element').css('height','120px');
于 2011-05-02T12:52:20.473 回答