【发布时间】:2015-11-25 23:50:29
【问题描述】:
我正在尝试编写功能,当您单击按钮时,textarea 将添加到我的弹出框内容的底部。 问题是当显示文本区域时,弹出框向下延伸并隐藏文本。 我希望弹出框只向上延伸(保存底部位置和原始宽度) 帮忙?
这是我的代码:
html:
<div class="popover-markup">
<a href="#" class="trigger">
This link triggers the popover.
</a>
<span class="content hide">
<p>This is the popover content.
</p>
<button id="clickme" onclick="showText()">click me</button>
<textarea class="textarea"></textarea>
</span>
</div>
js:
$(document).ready(function () {
$('.popover-markup > .trigger').popover({
html: true,
title: function () {
return $(this).parent().find('.head').html();
},
content: function () {
return $(this).parent().find('.content').html();
},
container: 'body',
placement: 'top',
html: true
});
$('.textarea').hide();
});
function showText() {
$('.textarea').show();
};
【问题讨论】:
标签: javascript jquery html css twitter-bootstrap