标签:style blog java color os width
1.JavaScript把控件id作为参数调用
<script type="text/javascript"> function xx(pmba) { document.getElementById(pmba).style.display = "block"; } </script>
<div id="overlay"> <input type="button" value="弹出A" onclick="xx('xa')" /><input type="button" value="弹出B" onclick="xx('xb')" /> </div> <div class="win" id="xa"> 网页a</div> <div class="win" id="xb">窗口b</div>
<script type="text/javascript" src="jQuery 2.0.3.js"></script> <script type="text/javascript"> function ShowMsg(xdiv)//调用函数时,传入控件id { var box = 300; var th = $(window).scrollTop() + $(window).height() / 1.6 - box; var h = document.body.clientHeight; var rw = $(window).width() / 2 - box; $('#'+ xdiv).animate({ top: th, opacity: 'show', width: 600, height: 340, right: rw }, 500);//最主要就是这个<span style="color:#FF0000;">$('#'+ xdiv)</span> return false; } function CloseMsg(ydiv) { $("#"+ydiv).animate({ top: 0, opacity: 'hide', width: 0, height: 0, right: 0 }, 500); } </script>
JavaScript或者Jqurey把控件id作为参数来调用,布布扣,bubuko.com
JavaScript或者Jqurey把控件id作为参数来调用
标签:style blog java color os width
原文地址:http://blog.csdn.net/yangmingxing980/article/details/37820301