jQuery 基础教程(第3版) ---第十章习题答案

//第一题
$(document).ready(function(){
    $('#gallery').delegate('div.photo','click',function(){
        $('div.photo').removeClass('selected');
        $(this).addClass('selected');
    });
});

//第二题
(function(){
    $(document).bind('pageLoaded',function(){
        console.log('new');
        $('#container #load').remove('#load');
    });
})(jQuery);
    
//第三题

    
//第四题



//第五题
$(document).ready(function(){
    var timer=0;
    $('div.photo').bind('mousemove',function(event){
        if(!timer){
            timer = setTimeout(function(){
            console.log(event.clientX+' '+event.clientY);
            timer=0;
        },200);
        }
    });
});


//第六题  未完成
(function($){
    $.event.special.throttledScroll={
        setUp:function(){
        }
    };
})(jQuery);

 

posted @ 2013-12-17 22:13  我只是程序员  阅读(274)  评论(0编辑  收藏  举报