I am working on a redirect script for a fancybox that loads a video, and then redirects the user to a new webpage when the fancybox is closed. I have the loader, and the redirect working.
However every video that is loaded redirects to the same page. I believe this to be a loop issue, and I could use some help.
// Jquery to load fancybox with iframes, and redirects
var sponsors = [
{selector: ".video_one", uri: "http://www.mysite.com"},
{selector: ".video_two", uri: "http://www.anothersite.com"}
];
$(document).ready(function(){
for(var i = 0; i < sponsors.length; i++) {
var msg = sponsors[i].uri;
var myDel = function(){window.location.replace(msg);}
$(sponsors[i].selector).fancybox({
'width' : '40%',
'height' : '60%',
'type' : 'iframe',
'closeBtn': false,
'afterClose': function(){myDel();}
});
}
});