前端开发程序员Web前端之路

2016阿里前端实习生笔试

2016-04-17  本文已影响789人  Beginning丶2015
~2 === -3; //true
~1 === -2; //true
~0 === -1; //true
~-1 === 0; //true

~ ~: 类似Math.floor()的用法,某些浏览器下比 Math.floor 渲染速度快
~~介绍
JavaScript 奇技淫巧

<div>
        <p>p1</p>
        <span>span1</span>
        <p>p2</p>
        <span>span2</span>
</div>
  1. div > :nth-last-child(2)
    //父元素倒数第二个元素
  2. p:nth-last-child(1)
    //错误
  3. p:nth-last-of-type(1)
    //仅匹配同种标签的元素,匹配到倒数第一个p
  4. p:nth-of-type(2)
    //仅匹配同种标签的元素,匹配到第二个p
  5. p:nth-child(2)
    //错误,匹配到父元素下的第二个元素
    http://www.ruanyifeng.com/blog/2009/03/css_selectors.html
innerHTML/innerText/children/childrennode/classname
("www.taobao.com").replace("tao","").split("").reverse().join("")
 <style>       
 #loading { 
           width: 100px;
            height: 100px;
            position: absolute;
            animation: circling 1s linear 0s infinite;
        }
        @keyframes circling {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }    
</style>
<body>
    <div id="loading"></div>
<body>

以前用css3写过一个摇头的(●—●)来着
http://begin5257.com/Baymax/
github地址

主要是星星和边框
原题 : )

 <style>
        a{
            border-radius: 10px;
            text-shadow: 0 1px #eee;
            box-shadow: 0 29px 0 rgba(222, 222, 222, 1) inset,0 0 0 6px #CACACA, 0 0 0        8px #fff, 0px 0px 0px 10px #696969, 0 2px 3px 11px #CBCBCB;

            background: rgba(182, 182, 182, 0.6);
        }
        a:before, a:after {
            font-size: 27px;
            color: #888;
            content: "★";
            text-shadow: 0 1px #fff;
        }
    </style>
触发方式,弹窗内容,消失方式
使用 try-catch / window.onerror 捕获异常
阻止常规报错
使用 ajax 将异常发送到某个页面
上一篇 下一篇

猜你喜欢

热点阅读