03jquery学习笔记----------------链式编程-循环注册事件的案例

<script src="jquery-1.8.3.js"></script>
    <script type="text/javascript">
        $(function () {
            //页面加载
            $('p').click(function () {
                //点击变红
                $(this).css('color', 'red');
            }).mouseover(function () {
                //DOM编程写法
                this.style.cursor = 'pointer';
            }).mouseleave(function () {
                //jquery编程写法
                $(this).css('color', '');
            });
        });
    </script>

  

posted on 2016-01-11 16:15  努力的活着_在人间  阅读(227)  评论(0)    收藏  举报

导航