我正在尝试在引导弹出窗口中实现一个表单;但我似乎无法将它们都对齐。表单元素移出弹出框;该解决方案应使弹出框根据表单元素的大小进行调整。请帮忙。
HTML:
<br> <br> <br>
<div class="popover-markup"><a href="#" class="trigger">Popover link</a>
<div class="head hide"> Events </div>
<div class="content hide">
<form class="form-horizontal">
<div class="control-group">
<label class="control-label" for="inputEmail">Email</label>
<div class="controls">
<input type="text" id="inputEmail" placeholder="Email">
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputPassword">Password</label>
<div class="controls">
<input type="password" id="inputPassword" placeholder="Password">
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox"> Remember me
</label>
<button type="submit" class="btn pull-left">Sign in</button>
</div>
</div>
</form>
</div>
Javascript:
$('.popover-markup>.trigger').popover({
html : true,
title: function() {
return $(this).parent().find('.head').html();
},
content: function() {
return $(this).parent().find('.content').html();
}
});
这是小提琴。