随笔分类 -  jQuery 基础教程(第3版) ---习题答案

摘要://第一题 $(document).ready(function(){ $('#gallery').delegate('div.photo','click',function(){ $('div.photo').removeClass('selected'); $(this).addClass('selected'); }); }); //第二题... 阅读全文
posted @ 2013-12-17 22:13 我只是程序员 阅读(288) 评论(0) 推荐(0)
摘要://第一题 $(document).ready(function(){ function stripe(){ $('#news').find('tr.alt').removeClass('alt'); $('#news tbody').each(function(){ $(this).children(':visible').has... 阅读全文
posted @ 2013-12-17 10:44 我只是程序员 阅读(261) 评论(0) 推荐(0)
摘要://第二题 1 (function($){ $.fn.shadow=function(opts){ var options = $.extend({},$.fn.shadow.defaults,opts); return this.each(function(){ var $originalEle... 阅读全文
posted @ 2013-12-16 15:17 我只是程序员 阅读(300) 评论(0) 推荐(0)
摘要://第一题 $(document).ready(function(){ $('#books').cycle({ timeout:3000, speed:1500, pause:true, before:function(){//回调函数 $('#slider').slider('value',$('... 阅读全文
posted @ 2013-12-04 09:33 我只是程序员 阅读(358) 评论(0) 推荐(0)
摘要://第一题 $(document).ready(function(){ $('#dictionary').load('exercises-content.html .letter'); }); //第二题 (好像不太合理,E不能显示出来) $(document).ready(function(){ $('div.letter h3 a').hover(function(event... 阅读全文
posted @ 2013-12-02 23:07 我只是程序员 阅读(260) 评论(0) 推荐(0)
摘要:1 //第一题 2 $('back to top').insertAfter('div.chapter p:gt(3)'); 3 $('').prependTo('body'); 4 5 //第二题 6 $('.chapter a[href*="top"]').click(function(){ 7 $('You were ... 阅读全文
posted @ 2013-12-01 15:48 我只是程序员 阅读(326) 评论(0) 推荐(0)
摘要://第一题 $('#container').fadeIn('slow'); //第二题 var color; $('p').hover(function(){ color = $(this).css('backgroundColor'); $(this).css('backgroundColor','yellow'... 阅读全文
posted @ 2013-11-30 10:52 我只是程序员 阅读(400) 评论(0) 推荐(0)
摘要://第一题 $('div.author').bind('click',function(){ $(this).addClass('selected'); //console.log(123); }); //第二题 $('h3.chapter-title').dblclick(function(event){ $(event.target).parent... 阅读全文
posted @ 2013-11-29 19:20 我只是程序员 阅读(462) 评论(0) 推荐(0)
摘要:1 //第一题 1. 2 $('#selected-plays>li>ul>li').addClass('special'); 3 //2. 4 $('li').children().find('li').addClass('special'); 5 6 //第二题 7 $('tr').find('td:eq(2)'... 阅读全文
posted @ 2013-11-29 15:55 我只是程序员 阅读(284) 评论(0) 推荐(0)