Revision history [back]

click to hide/show revision 1
initial version

asked 2018-08-26 21:00:06 +0800

psinalberth gravatar image psinalberth

Modal Window - Body Scrolling

Hi, I'm testing some modal window. The doModal(); method is invoked and everything works fine. My "problem" is with body behind modal, since it has a lot of content and it keeps scrolling. Is there any feature to fix that? I know that's the normal behavior and even Bootstrap does some workaround to do that by adding a modal-open class to body that sets overflow: hidden when their modal component is shown.

I've created an Interceptor looking for some onModal or onClose events to do something like that but I couldn't find them.

click to hide/show revision 2
Added some js piece of code

Modal Window - Body Scrolling

Hi, I'm testing some modal window. The doModal(); method is invoked and everything works fine. My "problem" is with body behind modal, since it has a lot of content and it keeps scrolling. Is there any feature to fix that? I know that's the normal behavior and even Bootstrap does some workaround to do that by adding a modal-open class to body that sets overflow: hidden when their modal component is shown.

I've created an Interceptor looking for some onModal or onClose events to do something like that but I couldn't find them.

[Update]

Now I'm trying to override a method from Window but when the page is shown I get this error message:

setAttr Maximum call stack size exceeded (RangeError)

Here is the piece of code:

zk.afterLoad(function() { zul.wnd.Window = zk.$extends(zul.wnd.Window, { doModal: function() { alert("Hi!!") this.$supers("doModal"); } }); });

Modal Window - Body Scrolling

Hi, I'm testing some modal window. The doModal(); method is invoked and everything works fine. My "problem" is with body behind modal, since it has a lot of content and it keeps scrolling. Is there any feature to fix that? I know that's the normal behavior and even Bootstrap does some workaround to do that by adding a modal-open class to body that sets overflow: hidden when their modal component is shown.

I've created an Interceptor looking for some onModal or onClose events to do something like that but I couldn't find them.

[Update]

Now I'm trying to override a method from Window but when the page is shown I get this error message:

setAttr Maximum call stack size exceeded (RangeError)

Here is the piece of code:

zk.afterLoad(function() {
    zul.wnd.Window = zk.$extends(zul.wnd.Window, {
            doModal: function() {
                alert("Hi!!")
                this.$supers("doModal");
            }
    });
});

});
Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More