美文网首页
px转vw(1920稿)

px转vw(1920稿)

作者: web小哥MrYang | 来源:发表于2019-09-26 13:11 被阅读0次

<!DOCTYPE html>

<html>

<head>

    <title>转换</title>

    <meta charset="utf-8" />

    <meta name="generator" content="前嗅网络" /> 

    <script src="/js/jquery.min.js" type="text/javascript"></script>

</head>

<style>

    .a{display: flex;justify-content:center;width: 100px;margin: 0 auto;}

    .a #a1,#a2{width: 300px;height: 80px;border: 1px solid #999999;box-shadow: 0 0 10px #999999;}

    #a{width: 100px;height: 80px;background: #999999;color: #ffffff;}

</style>

<body>

    <div class="a">

        <input type="text" id="a1" >

        <input type="text" id="a2">

    </div>

    <script>

        /*悬浮效果*/

        $(function () {

            $("#a1").blur(function(){

                var a1=$("#a1").val();

                var a2=(a1/1920).toFixed(6);

                $("#a2").val(a2*100+"vw");

           })

        })

    </script>

</body>

</html>

相关文章

网友评论

      本文标题:px转vw(1920稿)

      本文链接:https://www.haomeiwen.com/subject/jdziuctx.html