2012-08-31 121 views
1
<html> 
    <head> 
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> 
     <script type="text/javascript" src="jquery.blockUI.js"></script> 
     <script> 
      $(document).ready(function() { 
       $('#fullscreen').click(function() { 
        $.blockUI({ 
         message: $('#fs_div'), 
         css: { 
          top: 0, 
          left: 0, 
          width: 100% 
         } 
        }); 
       }); 
      }); 
     </script> 
    </head> 
    <body> 
     <button id="fullscreen">Fullscreen</button> 
     <div id="fs_div" style="display: none;">Fullscreen Div</div> 
    </body> 
</html> 

我已經寫了一個簡單的代碼,如上所示,以顯示jquery blockUI框但沒有任何反應,單擊按鈕。我四處尋找解決辦法,但我無法弄清楚我錯在哪裏。jquery blockUI沒有發生按鈕點擊

回答

1
<div id="fs_div" style="display: none;">Fullscreen Div</div> 

要設置width:100%

這將做到這一點

     css: { 
          top: 0, 
          left: 0, 
          width: '100%' 
         }