fancybox - how to scroll page when fancybox is foc

2019-06-01 21:05发布

go to: http://fancybox.net/ open any example (on bottom page)

when the mouse is hovered over the content inside the fancybox, the browser main window can´t be scrolled. when the mouse is anywhere else it works. i dont want this behavior. how would you fix this?

the page under the fancybox modal doenst scroll, when the mousecursor is inside the fancyboxmodal.

8条回答
祖国的老花朵
2楼-- · 2019-06-01 21:29

Add the following to the plugin options:

helpers:  {
    overlay: {
      locked: false
    }
}

Thanks to pheonix for pointing this at https://stackoverflow.com/a/14880963/1655981

查看更多
Lonely孤独者°
3楼-- · 2019-06-01 21:32

If you don't need ability to scroll images in gallery with mousewheel, then good solution is to add $('#fancybox-wrap').unbind('mousewheel.fb'); just after .fancybox() initialization as mentioned by vbulant

查看更多
登录 后发表回答