小编Sam*_*Liu的帖子

附加的div无法滚动

在谷歌浏览器我附加一个div.当我单击按钮时,红色div将滑出但不能用鼠标滚轮滚动.

该错误只发生在谷歌浏览器中.

这是一个示例页面:http://infinitynewtab.com/question/test.html

html,css和js:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>

<style type="text/css">
    body{
        margin: 0px;
        overflow: hidden;
    }
    #right{
        width:350px;
        height:100%;
        position: absolute;
        top:0px;
        right:-350px;
        background-color: red;
        overflow-y:scroll; 
    }
    #button{
        width:180px;
        height:40px;
        padding: 5px;
        background-color:rgb(75, 197, 142);
        margin-top: 200px;
        margin-left: auto;
        margin-right: auto;
        color:#fdfdfd;
        border-radius: 10px;
        cursor: pointer;
    }
    @-webkit-keyframes slideOut{
        0% {
            transform:translate(0px); 
            -webkit-transform:translate(0px); 
        }
        100% {
            transform:translate(-350px);
            -webkit-transform:translate(-350px);
        }
    }
    .slideOut{
        animation:slideOut ease 0.3s;
        -webkit-animation:slideOut ease 0.3s;
        transform:translate(-350px);
        -webkit-transform:translate(-350px);
    }
</style>
</head> …
Run Code Online (Sandbox Code Playgroud)

javascript jquery google-chrome css3 web

7
推荐指数
1
解决办法
124
查看次数

标签 统计

css3 ×1

google-chrome ×1

javascript ×1

jquery ×1

web ×1