2012-08-31 94 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%' 
         }