function prompt_fun(a) { $(a).after("
"); if ($('body').height() > $(window).height()) { $('#Layer1').height($('body').height()); } else { $('#Layer1').height($(window).height()); } $('#Layer1').width($('body').width()); $(a).css({ left: ($('body').width() - $(a).width()) / 2, top: $(window).scrollTop() + ($(window).height() - $(a).height()) / 2 }); $('#Layer1').fadeTo("fast", 0.6); $(a).show(); console.log('ok111'); $(a).fadeIn("slow"); $('#Layer1').click(function() { close_prompt_fun(a); }) } function close_prompt_fun(a) { $(a).fadeOut("fast"); $(a).hide(); document.getElementById("CuPlayer").innerHTML = '' $('#Layer1').fadeOut("slow", function() { $('#Layer1').remove(); }); document.getElementById("CuPlayer2").innerHTML = '' $('#Layer1').fadeOut("slow", function() { $('#Layer1').remove(); }); }