移动端Web,如何只能够滑动浮层?


先随便写一个demo


 <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
    *{margin:0;padding:0;}
        .a{background-color:red;width:100%;height:3000px;}
        .b{position:absolute;top:0;width:100%;height:2000px;background-color:blue;}
</style>
</head>
<body>
    <div class="a"></div>
    <div class="b"></div>
</html>

b是页面弹出的浮层,那么如何控制滑动屏幕的时候只滑动b,而a不滑动?

移动端web web前端开发 HTML css JavaScript

ditanbo 8 years, 7 months ago

让a页面固定fixed,关闭弹层再去掉

颓废的大肥猫 answered 8 years, 7 months ago

gldmxcs answered 8 years, 7 months ago

Your Answer