jQuery simplemodal disable scrolling

后端 未结 6 2123
被撕碎了的回忆
被撕碎了的回忆 2021-02-04 09:01

I have more than 2000 pixels scrolling content on a page.

If the user clicks a div a scrolling content pops up in a simplemodal window. Now my client wants

6条回答
  •  感情败类
    2021-02-04 09:44

    In your script to open your modal:

    $("html,body").css("overflow","hidden");
    

    And on close:

    $("html,body").css("overflow","auto");
    

    (HTML and body are required as the scroll bars are attached to different parts of the browser depending on which you are using)

提交回复
热议问题