[英]Increase and decrease the width of jquery mobile panel
我正在使用jquery移動面板。 我在面板中添加內容。
$("#load").on("click", function () {
var items = $("#p2 .ui-content").contents().clone();
$(this).after(items);
});
例:
http://jsfiddle.net/Palestinian/Lcbd2/
我想減小面板的寬度,但是當第二次在面板中添加內容時再次獲得實際尺寸。
面板的原始尺寸為width: 17em;
。
使用CSS使面板更小。
.ui-panel {
width: 12em !important;
}
如果要向左或向右定位特定的面板
.ui-panel-position-right {
width: 12em !important;
}
.ui-panel-position-left{
width: 12em !important;
}
演示
jQuery的 。 現在您知道面板的原始大小為17em ,可以在需要時使用以下代碼設置大小。
$(".ui-panel-position-right").css("width", "12em");
演示
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.