一款小巧的jquery.blockUI.js

今天发现一款老外的小巧的jquery.blockUI.js,比如能做弹出窗口,效果不错,

代码为:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>

   <script type="text/javascript" src="jquery.blockUI.js">

<input type="button" value="press" id="press" />
<script type="text/javascript">
                $(document).ready(function() {
                    $('#press').click(function() {
                        $.growlUI(null, 'Sample message');
                    });
                });
</script>



</script>

主要这个插件是用来在ajax请求的时候blockui的,给用户提示,等待等,参考介绍:

ThejQueryBlockUIPluginletsyousimulatesynchronousbehaviorwhenusingAJAX,withoutlockingthebrowser[1].Whenactivated,itwillpreventuseractivitywiththepage(orpartofthepage)untilitisdeactivated.BlockUIaddselementstotheDOMtogiveitboththeappearanceandbehaviorofblockinguserinteraction.

Usageisverysimple;toblockuseractivityforthepage:

更多的请参考http://jquery.malsup.com/block/

相关推荐