Moving body with modal frame sliding problem

Source: Internet
Author: User

Encountered a problem, is the click Link appears in the box, the contents of the box can be sliding, the results of my sliding when I found the following body also follow the slide, first look at the code.

The HTML of the Bullet box:

<Divclass= "Mask">    <Divclass= "Reserve">        <spanclass= "Close">X</span>        <Divclass= "title">Title</Div>        <Divclass= "Content">//A lot of content</Div>    </Div></Div>

CSS for the frame:

. Mask{position:fixed;Top:0; Left:0;width:100%;Height:100%;Display:None;Z-index:990;background:rgba (0, 0, 0,. 7);}. Reserve{position:relative;width:90%;Height:80%;Z-index:999;Overflow:Auto;Border-radius:10px;margin:100px Auto;Background-color:#fff;}

This is really no problem, but the problem followed, sliding content when the body will follow the slide, the following is the solution.

Add both HTML and body

{    height: 100%;     Overflow: hidden;}

This is how I solve this: When the button is clicked, the HTML and body are added with the . Ban_body so that the body does not slide along with it.

    {        $ ("Html,body"). AddClass ("Ban_body")        $ (". Mask"). Show (+);     )

Don't forget to remove it when you close it.

Moving body with modal frame sliding problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.