简体   繁体   English

页面的一部分上的jQueryUI或BlockUI模态对话框

[英]jQueryUI or BlockUI modal dialog over PART of a page

I want to have a modal dialog over part of a web page, just a div container. 我想在网页的一部分上有一个模式对话框,只是一个div容器。 I know a bespoke solution is likely the answer but I'm wondering if BlockUI can apply it's modal overlay to a specific div only . 我知道定制的解决方案可能是答案,但是我想知道BlockUI是否可以将其模式叠加层应用于特定的div。

Google/stackoverflow has bared no fruit when asking if this is possible with jQueryUI or BlockUI. 当询问使用jQueryUI或BlockUI是否可行时,Google / stackoverflow仍然没有结果。

Is modifying an existing overlay solution the only answer? 修改现有的覆盖解决方案是唯一的答案吗?

You can create a div with the particular dimensions and position, and then block that. 您可以创建具有特定尺寸和位置的div,然后将其阻止。

JS JS

$('body').append('<div id="blocker"></div>');
$('#blocker').block({message: null});

CSS 的CSS

#blocker {
    position: absolute;
    top: 50px;
    left: 100px;
    height: 75px;
    width: 150px;
}

Demo → 演示→

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM