2013-05-06 33 views
0

在我的jquery移動頁面中使用HTML自定義加載小部件。它與默認寬度完美配合。但我試圖有一個更小的部件:120px。所以,我有:居中更小的jquery移動HTML自定義加載微調器

//custom HTML loading widget 
$(document).on('mobileinit', function(){ 
    $.mobile.loader.prototype.options.text = 'Custom Loader'; 
    $.mobile.loader.prototype.options.textVisible = true; 
    $.mobile.loader.prototype.options.textonly = true; 
    $.mobile.loader.prototype.options.theme = 'a'; 
    $.mobile.loader.prototype.options.html = '<span class="ui-bar ui-overlay-c ui-corner-all" style="width:120px;"><img src="logo.png" width="120px;"/><h2>loading...</h2></span>'; 
}); 

我還添加CSS規則:

.ui-loader-verbose { 
    width: 120px; 
} 

小部件被適當調整。問題是小工具/微調不在中心了。

回答

1

您需要Ø玩此處的CSS一點點:

這個CSS塊將工作:

.ui-loader-verbose { 
    width: 120px; 
    margin-left: -50px; 
} 

您只需要調整利潤率左手動,但一旦設定它適合每一頁。不幸的是,我們不能使用標準的margin-left:auto;和margin-right:auto;水平居中div。