开发者

Redirect URL within Facebox

开发者 https://www.devze.com 2023-02-11 10:39 出处:网络
Take the \"Terms of Service\" example found on the developers page.If you click on \"Ok,\" I want the page to redirect elsewhere. I\'m modifying this code to show an image and the \"Ok\" button is rea

Take the "Terms of Service" example found on the developers page. If you click on "Ok," I want the page to redirect elsewhere. I'm modifying this code to show an image and the "Ok" button is really a delete button. I have everything working, except I'm not sure how to tie that button into an action.

  function picFunction(theurl) {
    var imgBox = new Facebox({
        ajaxDelay: 100,
        draggable: false,
        title: 'Terms and conditions',
   开发者_开发问答     url: theurl,
        submitValue: 'Delete',
        submitFunction: function() {
            imgBox.fade();
            var confirm = new Facebox({
                width: 200,
                title: 'Confirm',
                message: 'Are you sure you want to delete?',
                submitValue: 'Yes',
                cancelValue: 'No',
                submitFunction: function() {
                    confirm.close();
                    imgBox.close();
                },
                cancelFunction: function() {
                    confirm.fastclose();
                    imgBox.unfade();
                }
            });
            confirm.show();
        }
    });
    imgBox.show();
}


You need to update the window location to reload the page at the given URL. So your inner submitFunction should look something like this, you don't need to worry about closing the Facebox because the page will redirect anyway.

submitFunction: function() {
    window.location = 'http://www.pagetosendto.com'
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号