• 随笔开发中笔记


    微信小程序中视频的的控件样式 video   controls=“false” 是无效的  

    解决:

    controls="{{false}}"

    弹出的浏览器窗口居中显示

    function Fun(height,width){window.open ('src', '_blank', 'height='+height+', width='+width+',top='+(screen.height-height)/2+',left='+(screen.width-width)/2+' ,toolbar=no,menubar=no, scrollbars=no, resizable=no,location=n o, status=no'); }

    移动端布局 rem

     //移动端rem适配
    function getRem(pwidth,prem){
        var html = document.getElementsByTagName("html")[0];
        var oWidth = document.body.clientWidth || document.documentElement.clientWidth;
        console.log(oWidth);
        html.style.fontSize = oWidth/pwidth*prem + "px";
    } getRem(750,100);//1rem 等于100px

    购物车加减效果

     <button>+</button>
        <input type="text" value="1">
        <button>-</button>
        <script>
        var btn = document.getElementsByTagName('button');
        console.log(btn);
        var Input = document.getElementsByTagName('input')[0];
        btn[0].onclick = function() {
            Input.value = (Input.value++) === 999 ? 999 : Input.value;
        };
        btn[1].onclick = function() {
            Input.value = (Input.value--) == 0 ? 0 : Input.value;
        }
        </script>
    不积跬步,无以至千里;不积小流,无以成江海。
  • 相关阅读:
    Leetcode 121. Best Time to Buy and Sell Stock
    Leetcode 120. Triangle
    Leetcode 26. Remove Duplicates from Sorted Array
    Leetcode 767. Reorganize String
    Leetcode 6. ZigZag Conversion
    KMP HDU 1686 Oulipo
    多重背包 HDU 2844 Coins
    Line belt 三分嵌套
    三分板子 zoj 3203
    二分板子 poj 3122 pie
  • 原文地址:https://www.cnblogs.com/caoruichun/p/8985467.html
Copyright © 2020-2023  润新知