我正在尝试创建一个翻转的模态。前模态显示正常,但后模式只显示[对象HTMLDivElement]而不是显示模态。
<script type='text/javascript'>
$('#introModal').modal('show');
window.onload = function () {
function flip() {
var front = document.getElementById('introModal');
var back_content = document.getElementById('backModal'); // Generate or pull any HTML you want for the back.
var back;
// when the correct action happens, call flip!
back = flippant.flip(front, back_content)
// this creates the back element, sizes it and flips it around.
// call the close method on the back element when it's time to close.
}
document.getElementById('testbutton').onclick = flip;
};
</script>
答案 0 :(得分:0)
然后为它提取html:)
var back_content = $('#backModal').html()
或
var back_content = document.getElementById('backModal').innerHTML;
或
var back_content = document.getElementById('backModal').outerHTML;