这种要这么弄才可以?复制粘贴运行出来是一串乱码,小百提问,大老些轻点

代码演示:

$(function() {
$('#yes').click(function(event) {
modal('我就知道小姐姐您一定会愿意的。(^_^)', function() {
$('.page_one').addClass('hide');
$('.page_two').removeClass('hide');
// typeWrite();
fireworks();

    });
});
$('#no').click(function(event) {
    modal('明人不说暗话!', A);
});

});

function A() {
modal('我喜欢你!', B);
}

function B() {
modal('我知道你在等我这一句话', C);
}

function C() {
modal('请您不要拒绝我', D);
}

function D() {
modal('拒绝我,不存在的', E);
}

function E() {
modal('这辈子都不可能让你离开我', F);
}

function F() {
modal('跟我走吧', G);
}

function G() {
modal('房产证上写你名', H);
}

function H() {
modal('我会做饭', I);
}

function I() {
modal('爱你。么么哒!', J)
}

上诉代码表示如果没有同意的情况下,你点确定,会重复弹处如上,不过当道方法I,及弹处爱你/么么哒时,后面有个j,表示调用了方法j,而j写了结束该部分,就会直接带你去看烟花,文字部分可改
function J() {
modal('行,我们去民政局登记吧', function() {
fireworks();
});
}

function fireworks() {
$('.page_one').addClass('hide');
initAnimate();
}

function modal(content, callback) {
var tpl = '

'+
'
'+
'
'+
'

'+ content +'

'+
'确定'+
'
'+
'
';
$('body').append(tpl);
$(document).on('click', '.confirm', function() {
$('.container').remove();
callback();
});
}