google-code-export / nyromodal

Automatically exported from code.google.com/p/nyromodal
1 stars 1 forks source link

Add overflow:hidden to html or body, before nm open modal box #579

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, as I say in summary, is there a way to add css property at body or html tag 
to prevent scrolling page when a modal box open to pop up?
Many thanks, and have a nice day!

Original issue reported on code.google.com by ildrago....@gmail.com on 10 Nov 2011 at 10:32

GoogleCodeExporter commented 9 years ago
Well, after some search and few attempts i solved adding a callback:
[code]
    <script type="text/javascript">
        $(function () {
            $("[data-gal^='nyromodal']").nm({
                callbacks: {
                    beforeShowCont: function (nm) {
                        $('body').css('overflow', 'hidden');
                    }
                }
            });
        });
    </script>
[/code]
Maybe I hope it will be usefull.
Bye! :)

Original comment by ildrago....@gmail.com on 10 Nov 2011 at 10:54

GoogleCodeExporter commented 9 years ago
This is exectaly what I've been looking for, but unfortunately this is not 
working.  
Any ideas why?

Original comment by ben.bibi...@gmail.com on 24 Apr 2014 at 11:04

GoogleCodeExporter commented 9 years ago
The above fix worked for me, thanks!  I was getting complaints about a double 
scroll bar when making the dialog very small.  The above cleared it up.

Original comment by beardybr...@gmail.com on 22 Sep 2014 at 10:00