define(function (require) { require("bootstrap");//¼ÓÔØbootstrap require('dialog');//¼ÓÔص¯´° require('dialogcss');//¼ÓÔص¯´° var modal = new Modal({ title: '²âÊÔ°¸Àý', content: $('#modal-tpl').html(), width: "90%", onOk: function () { //²Ù×÷ alert("Äãµã»÷ÁËÈ·¶¨"); }, onModalShow: function () { //µ¯´°³õʼ»¯²Ù×÷ } }); $(".btn").each(function (index) { $(this).on("click", function () { if(index==0) { $('body').dailog({ type: 'defalut' }); }else if(index==1) { $('body').dailog({ type: 'success' }) } else if (index == 2) { $('body').dailog({ type: 'primary' }) } else if (index == 3) { $('body').dailog({ type: 'danger' }) } else if (index == 4) { $('body').dailog({ type: 'warning' }) } else if (index ==5) { $('body').dailog({ type: 'success', maskBg: 'rgba(33,11,22,0.5)' }) } else if (index ==6) { $('body').dailog({ type: 'danger', title: 'ÎÒÊÇ×Ô¶¨Òå±êÌâ', discription: 'ÕâÀïÊÇ×Ô¶¨ÒåµÄÃèÊö£¬¿ÉÒÔдÉÏÄãµÄÃèÊö»òÕßËûµÄÃèÊö£¬×ÜÖ®¿ÉÒÔдºÜ¶àÎÄ×Ö£¬Äã×Ô¼º¿´×Å°ì°É' }, function (ret) { if (ret.index == 0) { alert("Äãµã»÷ÁËÈ·¶¨°´Å¥"); } else { alert("Äãµã»÷ÁËÈ¡Ïû²Ù×÷"); } console.log("ÐÅϢΪ£º"+JSON.stringify(ret)); }) } else if (index ==7) { $('body').dailog({ type: 'danger', title: '´íÎóÌáʾ', discription: 'ÕâÀïÊÇ×Ô¶¨ÒåµÄÃèÊö£¬¿ÉÒÔдÉÏÄãµÄÃèÊö»òÕßËûµÄÃèÊö£¬×ÜÖ®¿ÉÒÔдºÜ¶àÎÄ×Ö£¬Äã×Ô¼º¿´×Å°ì°É', isInput: true }, function (ret) { console.log(ret); if (ret.index === 0) { alert('Äãµã»÷µÄÊǵÚ' + ret.index + '¸ö°´Å¥,״̬:' + ret.input.status + ';ÊäÈëµÄֵΪ:' + ret.input.value) }; }); } else if (index == 8) { $('body').dailog({ type: 'defalut', showBoxShadow: true }) } else if (index ==9) { $('body').dailog({ type: 'success', showBoxShadow: true, maskBg: '#fff' }) } else if (index == 10) { $('body').dailog({ type: 'primary', showBoxShadow: true, maskBg: '#ccc' }) } else if (index == 11) { $('body').dailog({ type: 'primary', showBoxShadow: true, animateStyle: 'none' }) } else if (index == 12) { $('body').dailog({ type: 'warning', showBoxShadow: true, animateStyle: 'none', bottons: ['È·¶¨'], discription: 'Ò²ÐíÓеãÎÊÌâ!' }) }else if(index==13) { modal.open(); } else if (index == 14) { $('body').dailog({ type: 'defalut',showBoxShadow: true, animateStyle: 'none',isnobutton:false, bottons: ['¹Ø±Õ'], discription: 'Ò²ÐíÓеãÎÊÌâÒ²ÐíÓеãÎÊÌâÒ²ÐíÓеãÎÊÌâÒ²ÐíÓеãÎÊÌâÒ²ÐíÓеãÎÊÌâÒ²ÐíÓеãÎÊÌâÒ²ÐíÓеãÎÊÌâÒ²ÐíÓеãÎÊÌâÒ²ÐíÓеãÎÊÌâ!' }); } }) }) })
¡¡¡¡dialog.jsºÍcss £¬ÎÒ´ò¸ö°ü£¬´ó¼ÒÏëÏÂÔؾÍÏÂÔØÓðÉ
Èç¹û¾õµÃ»¹¿ÉÒÔ£¬¿ÉɨÒÔ϶þάÂ룬ÉͶàÉÍÉÙ¶¼ÊÇÄú¶ÔÎÒµÄ×î´ó¹ÄÀø
¡¡