1. 程式人生 > >Jquery實現確定取消對話方塊

Jquery實現確定取消對話方塊

 <a id="demo3">測試(<span></span>)</a>

     $('#demo3').on('click', function () {

                popTipShow.confirm('付款方式', '請選擇支付方式', ['微信支付', '餘額支付'],

                    function (e) {

                        //callback 處理按鈕事件

                        var button = $(e.target).attr('class'

);

                        if (button == 'ok') {

                            //按下確定按鈕執行的操作

                            this.hide();

                            setTimeout(function () {

                                webToast("微信支付頁", "center", 600);

                            }, 300);

                        }

                        if (button == 'cancel') {

                            //按下取消按鈕執行的操作

                            this.hide();

                            setTimeout(function () {

                                webToast("餘額支付頁", "center", 600);

                            }, 300);

                        }

                    }

                );

            });