当前位置: 代码迷 >> Web前端 >> JQuery Blockui遮罩效能
  详细解决方案

JQuery Blockui遮罩效能

热度:32   发布时间:2012-11-06 14:07:00.0
JQuery Blockui遮罩功能

.jsp 页 面内 实现 (写在 <head> 与 </head> 之 间 )

<script type="text/javascript" src=" <s:url value="/js/jquery-1.3.2.js" />" ></script>

<script type="text/javascript" src=" <s:url value="/js/jquery.js" />" ></script>

<script type="text/javascript" >

??? $(document).ready(function () {?

??????? $( ‘ #test’).click(function () { <!--test,question , no 为 控件的 id-->

??????????? $.blockUI({ message: $( ‘ #question’),

<!-- 遮罩 页 面, 显 示 id 为 question 的控件 -->

??????????? css: {

??????????????? top:? ($(window).height() - 500) /2 + 'px',

??????????????? left: ($(window).width() - 700) /2 + 'px',

??????????????? width: '700px'?

??????????????? } <!--css 样 式 -->

??????????? });????????????

??????? });?

??????? $( ‘ #no’).click(function () {

??????????? $.unblockUI(); <!-- 当 click? id 为 no 的控件,解除 页 面遮罩 -->

??????????? return false ;

??????? });

});

</script>

注: id 为 question 和 no 的控件可以是 隐 藏的

Example:<div id="question" style="cursor: default; display: none;" > … </div>

?

  相关解决方案