0

I have a jquery modal popup which is opened in this way:

var OpenPurchasePage = function (productID) {
        $(this).spPopup(
        {
            width: 625,
            height: 445,
            useFrame: true,
            effectIn: "zoomIn",
            effectOut: "slideZoom",
            css3Effects: "flipInVer",
            href: '../purchase/delegate.aspx?sid=' + productID,
            onClose: function () { parent.location.reload(true); }
        });
    }

The popup plugin I use, supports onClose event and I need to refresh my parent page while the popup being closed. But the problem is that I use CSS3 efects available in that plugin, and I want the closing effect being ran entirely before OnClose function being triggered. Suppose that the closing effect needs 2 seconds for being berformed flawlessly. But the porblem is OnClose function gets triggered instantly and the closing effect does not perform completely.

I tried methods mentioned in:

But none of them makes the process of parent page being reloaded delayed until the effect being performed (e.g. delayed for 2 seconds).

Can you please guide on how this interval can be created?

Community
  • 1
  • 1
Farshid
  • 5,134
  • 9
  • 59
  • 87

1 Answers1

1

setTimeout should work definitly: onClose: function () { window.setTimeout(myfunc, 2000); }

then you need a function function myfunc () { parent.location.reload(true); }

What is parent? Does it works this way already?

luk2302
  • 55,258
  • 23
  • 97
  • 137
  • No, I tried this. It causes my popup window being closed after 2 seconds even if user does nothing at all to close the window. Actually this method works like an automatic timer even though it is placed inside an anonymouse function for OnClose event. – Farshid Jun 02 '13 at 13:35