To use a small ajax code to open some links! But sometimes these links have some videos !! And until it loads !! Only the problem is that these links are opened in a lightbox! And when you close the lightbox the video keeps rolling !! Which sucks! Because it actually only closes the lightbox! You do not "end" the link!
How do you perform this link "closure" as soon as you close lightbox?
Lightbox Script
$(document).ready(function() {
$('.lightbox').click(function(){
$('.background, .box').animate({'opacity':'.9'}, 1, 'linear');
$('.box').animate({'opacity':'1.00'}, 1, 'linear');
$('.background, .box').css('display','block');
});
$('.close').click(function(){
$('.background, .box').animate({'opacity':'0'}, 1, 'linear', function(){
$('.background, .box').css('display','none');
});
});
});
Ajax Code
//Carregamento AJAX
function pag(brl)
{
var url = eval("brl");
$( "#content" ).load(url, function(e) {
e.preventDefault()
});
}
Link is like this :::
<a class="home lightbox" href="#!" onclick="pag('urlaseraerta.php');">link</a>