flippant.js不会拉HTML。而是显示[object HTMLDivElement]

时间:2014-07-16 13:32:19

标签: javascript jquery flippant

我正在尝试创建一个翻转的模态。前模态显示正常,但后模式只显示[对象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>

1 个答案:

答案 0 :(得分:0)

然后为它提取html:)

var back_content = $('#backModal').html()

var back_content = document.getElementById('backModal').innerHTML;

var back_content = document.getElementById('backModal').outerHTML;