SoFunction
Updated on 2025-04-10

Pop up the simplest patterned mask layer js code


<script type=”text/javascript”>
$(function(){
//Get the internal width and height of the current browser
varnWidth = ;
varnHeight = ;
//Set the width and height of the mask layer
$("#shade").width(nWidth);
$("#shade").height(nHeight);
//Set the close button to center to display
$("#close").css("margin-top",nHeight/2-50+"px");
//Set the event that fires when the browser size changes
$(window).resize(function(){
//Get the internal width and height of the current browser
varnWidth = ;
varnHeight = ;
//Set the width and height of the mask layer
$("#shade").width(nWidth);
$("#shade").height(nHeight);
//Set the close button to center to display
$("#putPwd").css("margin-top",nHeight/2-50+"px");
});
//Set the close button to eliminate the mask layer
$("#close").click(function(){
$("#shade").removeAttr("id");
$("#shade").html("");
});
//You can also use pure js to write
(“shade”).style…….;
//It is useless to say more later. If you are interested but really don’t know how to write, you can contact me.
})
</script>