window.closeAndRedirect = function() {
parent.$.fancybox.close();
window.parent.location.href = '/shop/basket';
}
setTimeout(closeAndRedirect, 5000); // 5 seconds
@jAndy pointed out: why would you want to close something if you are redirecting anyway?, which is a valid point.
maybe you meant close, THEN redirect 5 seconds after closing? If so:
parent.$.fancybox.close(function() {
setTimeout(function() {
window.parent.location.href = '/shop/basket';
});
});
assuming that close has a callback. If not, maybe:
parent.$.fancybox.close();
setTimeout(function() {
window.parent.location.href = '/shop/basket';
});