论坛首页 Web前端技术论坛

JQuery Plug-in BlockUI

浏览 6367 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2007-07-20  
js 代码
  1.      
  2.   
  3. Overview   
  4.   
  5. The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser[1]. When activated, it will prevent user activity with the page (or part of the page) until it is deactivated. BlockUI adds elements to the DOM to give it both the appearance and behavior of blocking user interaction.    
  6.   
  7.     
  8.   
  9. Jquery BlockUI 插件 使你能够在不用锁定浏览器的情况下利用AJAX实现模拟同步。当插件被激活,他将会屏避用户对于页面,或者一部分页面的操作知道他被释放。BlockUI通过向DOM添加节点的方式,使得页面设计者能够设计出能够将用户超作屏避的界面和超作方式。   
  10.   
  11. Usage is very simple; to block user activity for the page:    
  12.   
  13. 使用起来非常简单,下面的语句将会屏避用户对当前页面的一切超作:   
  14.   
  15. $.blockUI();   
  16.   
  17. Blocking with a custom message:    
  18.   
  19. 屏避的时候给用户的提示信息;   
  20.   
  21. $.blockUI( '   
  22.   
  23.  Just a moment...   
  24. ' );   
  25.   
  26. Blocking with custom style:    
  27.   
  28. 利用用户设定的样式屏避用户操作   
  29.   
  30. $.blockUI( { backgroundColor: '#f00', color: '#fff'} );   
  31.   
  32. To unblock the page:   
  33.   
  34. 解除页面锁定    
  35.   
  36. $.unblockUI();   
  37.   
  38. If you want to use the default settings and have the UI blocked for all ajax requests, it's as easy as this:   
  39.   
  40. 如果想在得到所有Ajax请求之后为页面解锁,很简单,可以这样作:    
  41.   
  42. $().ajaxStart($.blockUI).ajaxStop($.unblockUI);   
  43.   
  44. [1] Using the XMLHttpRequest object in synchronous mode causes the entire browser to lock until the remote call completes. This is usually not a desirable behavior.    
  45.   
  46. [1]在同步模式下使用XMLHTTPRequest对象会引起整个浏览器出于被锁定的状态,直到所有的远程请求完成。而这一现象并不是我们所希望看到的。   
   发表时间:2007-07-20  
$和Dwr的$ 冲突阿
0 请登录后投票
   发表时间:2007-07-21  
$大家都喜欢用$
0 请登录后投票
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics