简体   繁体   中英

Covering only part of the window with a JQuery modal (optionally SimpleModal)

I have a button click on an ASP.NET page that I expect to take a while. I want to show a small loading gif over the frame that the user has been inputting data to signal the user that things hare happening, but so far I have completely failed to restrict the overlaying modal to the active frame. It instead covers the whole screen, which I do not want; there is other navigation on the page that the user should still have access to so they may navigate away if it takes too long and they get bored.

How may I modify the modal's invocation so it only blocks off the part of the page that the user has modified (eg, one specific div)?

Due to the proprietary 'workflow' system being used on this project, I am unable to use simple AJAX techniques to do what I need; frustratingly, even though the logical page doesn't change (it is still Webpage1.aspx), the fields and such change quite a bit, so AJAX invocations will not work across workflow steps. That is my large problem here; the button click I am using changes workflow steps.

EDIT: I have mostly been doing my experimentation so far with SimpleModal, so I'm reasonably comfortable with that, but I am not bound to it by any means if there's a standard JQuery way of doing this.

For what it's worth (nobody seems to be looking at this topic but I hate to leave something undone), I figured this out and this is what you're looking for in SimpleModal:

            $('#TheModal').modal({
                opacity: 0,
                modal: false         
            });

That makes a basic modal box that can pop up, doesn't output any backdrops, and doesn't block off the whole page. You can then use the other styling options to put it wherever you want.

This is pretty dirty since you're effectively taking a modal plug-in and telling it not to behave as a modal, but for the ridiculous situation I'm in it seems to work pretty well!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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