CMS, Coding

Video lightbox in drupal

// front page pop up video
if($(‘#video-wrapper’).length){
var front_video = $(‘#video-wrapper’);
var overlay = $(‘#video-wrapper-overlay’);
$(‘#video-wrapper .video-content div.video-link’).attr(‘id’,’front-video-popup’);
//alert(front_video.width());
var pop_margin1 = (body.width()-front_video.width())/2;
var pop_margin2 = (body.height()-front_video.height())/2;
front_video.css({
‘left’:pop_margin1,
‘right’:pop_margin1,
‘top’:pop_margin2,
‘bottom’:pop_margin2
});
front_video.css(‘display’,’none’);
var click_play = $(‘#block-block-1 img.awardee-click-play’);
click_play.click(function(){
front_video.fadeIn(‘fast’);
toggleVideo(‘show’,’front-video-popup’);
overlay.css(‘display’,’block’);
});
$(‘#video-wrapper div.close,#video-wrapper-overlay’).click(function(){
front_video.fadeOut(‘fast’);
toggleVideo(‘hide’,’front-video-popup’);
overlay.css(‘display’,’none’);
});
$(window).resize(function(){
var pop_margin1 = ($(‘body’).width()-$(‘#video-wrapper’).width())/2;
var pop_margin2 = ($(‘body’).height()-$(‘#video-wrapper’).height())/2;
$(‘#video-wrapper’).css({
‘left’:pop_margin1,
‘right’:pop_margin1,
‘top’:pop_margin2,
‘bottom’:pop_margin2
});
});
}

Add your comments

Loading Facebook Comments ...
Loading Disqus Comments ...