zoukankan      html  css  js  c++  java
  • css之transition上下动画效果

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>css之transition动画效果</title>
        <style>
            body,html{
                position: relative;
            }
            #root{
                position: relative;
                top: 200px;
                left: calc(50% - 150px);
                width: 300px;
                height: 300px;
                background-color: yellow ;
                overflow: hidden;
            }
            #root:hover #box{
                top: 0;
            }
            #box{
                width: 300px;
                height: 300px;
                background-color: skyblue;
                position: absolute;
                top: -100%;
                transition: all ease-in 2s;
            }
            #box button {
                position: absolute;
                bottom: 0;
                right: 0;
            }
            #box:active{
                background-color: red;
            }
        </style>
    </head>
    <body>
        <div id="root">
            <div id="box">
                <button onclick="toBuy()">购买</button>
            </div>
        </div>
    </body>
    </html>
    <script>
        function toBuy(){
            alert('购买成功')
        }
    </script>
  • 相关阅读:
    PerfDog
    adb 常用操作
    netstat命令(net-tools)
    资源路径总结:
    四个作用域对象:
    jsp的 九大内置对象
    Jsp 的语法和指令
    JSP 学习
    server.xml 文件:
    Web.xml 文件使用总结:
  • 原文地址:https://www.cnblogs.com/-roc/p/13634838.html
Copyright © 2011-2022 走看看