Answer the question
In order to leave comments, you need to log in
How to make an ad player overlay on the main one, in js?
Hi all the people there was a question about the overlay of the player with advertising on the main player.
I found this code on the internet:
<script type="text/javascript" src="http://yandex.st/jquery/1.7.2/jquery.min.js"></script>
<div id="advm_preload" style="width:0px;height:0px;text-align:center;z-index:1000;overflow:hidden;">
<font color="#f0f0f0">Рекламма закроется автоматически через 20 сек</font>
<iframe width="560" height="315" src="https://www.youtube.com/embed/Zfy_8R9UBXs" frameborder="0" allowfullscreen></iframe>
<div style="background:#ffffff;color:#000000;">
<span id="advm_close" style="cursor:pointer">Закрыть рекламу</span>
<div style="border:red solid 1px;" class="advm_loader">Идет загрузка... осталось <span id="advm_timer"></span> сек.</div>
</div>
</div>
<script type="text/javascript">
$(function(){
var advm_height = $('#advm_preload').parent().height();
var advm_width = $('#advm_preload').parent().width();
$('#advm_preload,#advm_close,.advm_loader,#advm_preload > div').css('display','block');
$('#advm_preload').parent().find('object').append('<param name="wmode" value="opaque">');
$('#advm_preload').parent().css('position', 'relative');
$('#advm_preload').css({'position':'absolute', 'top':advm_height/2-230+'px', 'left':advm_width/2-350+'px', 'width':'700px', 'height':'450px'});
$("#advm_timer").html(advm_timer);
var advm_timer = 20;
function advmPreload(){
$("#advm_timer").html(advm_timer--);
if(advm_timer>0){
setTimeout(function(){ advmPreload(); },1000);
}else{
$("#advm_preload").hide();
}
}
setTimeout(function(){ advmPreload(); },1000);
$('#advm_close, #advm_preload').click(function(){
$('#advm_preload').hide();
});
});
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question