I’ve implemented the nyroModal jQuery Plugin into my website.
I have set up a javascript file that configures a nyroModal Windows:
$("a.nyroModal").nyroModal({
bgColor: '#000',
width: 680,
height: 500
});
Now, the opened nyroModal window need a link where I can close the nyroModal window and thereafter redirect to a specific page.
I created a close and redirect link:
<a onclick="parent.$.nyroModalRemove(); window.parent.location.href = 'user/login';
return false;" href="#">log in</a>
However, the window is redirected before nyroModal is closed – which doesn’t look nice.
I want to implement a call back, but I don’t know how to do this.
Create a function to call from your onclick, like:
Then create that function that calls the .close() function, then runs a timeout before calling the redirect:
Enjoy 🙂