(function ($) { var settings,popupsApply_layer; var popupsApplyCss = $('') popupsApplyCss.insertAfter( lastLink = $('head').children('link').last()); var defaults = { applyTitle:'万博体育电脑客户端装饰,良心打造!', nameP:'请输入您的名字', telP:'请输入您的手机号', source:'弹出报名框', btnText:'预约报名', background:'ybj_bj.jpg' } var _renderDOM = function () { popupsApply_layer = $('
\n' + '
\n' + ' \n' + '

'+settings.applyTitle+'

\n' + '
\n' + '
\n' + ' \n' + ' \n' + ' \n' + '
'+settings.btnText+'
\n' + '
\n' + '
\n' + '
\n' + '
'); $('body').append(popupsApply_layer); $('.popupsApply_cont').css({'backgroundImage':'url("/Public/Home/images/module/module.popupsApply/'+settings.background+'")'}); popupsApply_layer.addClass('popupsApply_layer_show'); }; var _bindEvent = function () { $('.popupsApply_close').on('click',function () { $.popupsApply.close(); }); popupsApply_layer.find('.submite_Btn').click(function () { var oForm = $(this).parents('.form_box'); var data = mergeData([getUserData(oForm), getUtmData()]); function sFun(data) { oForm.find('.name').val(''); oForm.find('.tel').val(''); $.popupsApply.close(); } applyFun(data,sFun) }) } $.popupsApply = function (option) { settings = $.extend({}, defaults, option); _renderDOM(); _bindEvent(); return this; }; $.popupsApply.close = function () { popupsApply_layer.removeClass('popupsApply_layer_show'); popupsApply_layer.remove(); } })(jQuery);