<p style=" display:none" id="yinying"></p> <script type="text/javascript"> function showUnitInfo() { var screenWidth = $(window).width();//当前窗口宽度 var screenHeight = $(window).height();//当前窗口高度 $("#yinying").css({"display":"","position": "fixed","background": "#000","z-index": "1001","-moz-opacity": "0.5","opacity":".50","filter": "alpha(opacity=50)","width":screenWidth,"height":screenHeight}); } </script>
jquery写的,使用前需要引用类库。
先写一个不不显示的p,当触发事件时,为这个p添加样式,高度=当前窗口高度,宽度=当前窗口宽度。
如对本文有疑问, 点击进行留言回复!!
POJ 3692 Kindergarten(挑战程序设计竞赛,二分图最大团)
网友评论