2011-07-30 76 views
2

我使用'Colorbox'(http://colorpowered.com/colorbox/)jQuery插件来显示模式窗口。模态窗口之一是登录窗口。它将外部登录页面加载到模态窗口中。登录模式窗口后刷新/更新主页面

问题是当我在模态窗口中输入我的凭证并登录时,它在窗口内正确登录。但是,当我关闭窗口时,主页面(包含到登录模式窗口的链接)仍显示陈旧的“未登录”状态。我需要刷新整个页面以查看“登录”状态。

如何在我登录并关闭登录模式窗口后立即更新主页面。

回答

1

存在这样下面的颜色框中onclosed功能,您可以在使用上onClosed功能window.load功能

$(".example9").colorbox({ 
       onOpen:function(){ alert('onOpen: colorbox is about to open'); }, 
       onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); }, 
       onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); }, 
       onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, 
       onClosed:function(){ alert('onClosed: colorbox has completely closed'); } 
      }); 
+0

您可以使用Onclosed刷新功能,例如上面用警告框 – devtut

+0

对此我是新手,你能告诉我重写命令在这里写吗? :( –

+0

我的意思是刷新命令 –