var news={ 'init':function(){ modal.init(); this.btn_bind(); }, 'btn_bind':function(){ //新增消息 $('.btn_add').click(function(){ $('.bs-modal-lg') }); //送出消息 $(document).on('click','.btn_snd',function(){ var cfm=confirm('確定要送出嗎?'); if(!cfm)return false; news.snd_data(); }); }, 'snd_data':function(){ var data=ANK.get_form_data($('.bs-modal-lg .tb_news')); data['type']='snd_data'; $.post('/ajax.php?md=news&site=ajax/ajax_news.php&user=_main',{'data':data},function(gdata){ alert(gdata['desc_str']); if(gdata['status']){ location.reload(); }else{ } },'json'); } } var modal={ 'init':function(){ this.btn_bind(); //set z-index for modal $('.bs-modal-lg').css("z-index","6050"); }, 'btn_bind':function(){ //bind modal LG $(document).on('click','.show_modal',function(){ $('.bs-modal-lg').modal(); }); }, 'loading':function(){ var mobj=$('.bs-modal-lg'); mobj.find('.modal-title').html(''); mobj.find('.modal-body').html('Loading...'); } } $(document).ready(function(){ news.init(); });