jquery的一些便捷函数

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
    </head>
    <style type="text/css">
    div{width: 300px;height: 200px;border: 1px solid #000;text-align: center;line-height: 200px;}
    </style>
    <body>
        <div>用.css获取和便捷函数的区别</div>
    </body>
    <script type="text/javascript" src="jquery-1.11.1.min.js"></script>
    <script type="text/javascript">
    $(function(){
        // alert($('div').css('height')) //弹出 200px
        // alert($('div').height()) //弹出 200
         alert($('div').height()+100) //弹出 纯数字的好处是可以直接相加
        
    })
    </script>
</html>

 

posted @ 2017-01-18 18:24  Model-Zachary  阅读(130)  评论(0编辑  收藏  举报