Jquery BlockUI element blocking

你。 提交于 2019-12-10 11:12:42

问题


I am trying to block certain part of the page.I am following the http://jquery.malsup.com/block/#element tutorial, but i am not able to map the element .

My js:

 $('div.repoDisplay').blockUI({ message: '' ,overlayCSS: { backgroundColor: '#fff'   }});

My html :

  <div class="container-sc" style="display: table;">
   <div id='repoDisplay' >
    <div style="display: table-cell;width:150px">
     \\\\\\\\\\\
      </div>
   </div>


   <div style="display: table-cell;padding:10px;width:85%"">
   {{outlet}}             
   </div>

</div>

But it is showing uncaught type error:undefined in my js.

Thanks for the help


回答1:


$.blockUI() is using to block whole page, If you want to block element section then use block() function only, and use right <selector> repoDisplay is id so you need to use with #, see below code

$('div#repoDisplay').block({
    message: '' ,
    overlayCSS: { backgroundColor: '#fff'   }
 });

FIDDLE Demo



来源:https://stackoverflow.com/questions/25304637/jquery-blockui-element-blocking

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!