.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>