资源预览内容
第1页 / 共5页
第2页 / 共5页
第3页 / 共5页
第4页 / 共5页
第5页 / 共5页
亲,该文档总共5页全部预览完了,如果喜欢就下载吧!
资源描述
.chapterwidth:42em;a.linktext-decoration:none;span.footnotefont-style:italic;font-family:TimesNewRoman,Times,serif;display:block;/*使其变成一块一块的*/margin:1em0;.text-referencefont-weight:bold;#noteslimargin:1em0;#notesmargin-top:1em;border-top:1pxsolid#00ff00;#footermargin-top:1em;border-top:1pxsolid#dedede;/*上边线*/.inhabitantsborder-bottom:1pxsolid#dedede;.pulled-wrapperbackground:url(pq-top.jpg)no-repeatlefttop;position:absolute;width:160px;right:-180px;/*定位注释框的横向位置*/padding-top:18px;.pulledbackground:url(pq-bottom.jpg)no-repeatleftbottom;position:relative;display:block;width:140px;padding:010px24px10px;font:italic1.4emTimesNewRoman,Times,serif;/为每个p元素添加属性$(document).ready(function()$(p).each(function(index)varcurrentClass=$(this).attr(class);$(this).attr(class,currentClass+inhabitants);););/动态为元素添加属性$(document).ready(function()$(div.chapterahref*=cnblogs).each(function(index)/each好似for循环,他会循环集合中所有的对象,参数一的方法是对每一个对象都执行的操作,index是对象的索引var$thisLink=$(this);$(this).attr(rel:subsection,id:blogslink-+index,title:更多+$thisLink.text()+的资料在冯瑞涛的博客,class:link);););/插入返回到上面连接$(document).ready(function()$(新年好).prependTo(body);/初始化到body$(div.chapterp:gt(0).after(返回到上面);/下行等价上面的哪行代码gt代表从第几个元素后面的p开始/$(返回到上面).insertAfter(div.chapterp:gt(0););/$(document).ready(function()$().insertAfter(div.chapter);$(span.footnote).each(function(index)$(this)/为每一个footnote在前面动态添加数字连接(1,2).before(+(index+1)+)/将footnote插入到ol标签中(不带上面的连接,仅span),就是移动标签,带有appendTo代表将自己追加到其他元素中.appendTo(#notes)/向指定元素内容的后面追加标签.append( (内容)/将this包含在wrap的第一个参数中表示的标记中.wrap();););$(document).ready(function()$(span.pull-quote).each(function(index)/获得父元素pvar$parentParagraph=$(this).parent(p);/设置p标签为相对定位,否则无法对其位置进行操作$parentParagraph.css(position,relative);/复制一份拷贝,span.pull-quoteclone(false);代表仅复制标记本身不复制其内容var$clonedCopy=$(this).clone();$clonedCopy.addClass(pulled)/添加样式,拥有下面的背景.find(span.drop)/找到其中的span.drop,此时对象已经是span.drop了.html(…)/为span.drop设置html文档.end()/返回没有被改变前的那个jQuery对象状态.prependTo($parentParagraph)/将这个span追加到指定的元素中去.wrap();/再其本身包含在div内容中varclonedText=$clonedCopy.text();/获得文本,去掉了html$clonedCopy.html(clonedText);/将文本以Html的形式插入到内容中,相当于替换html内容););佳月Terry.Feng.C冯瑞涛1.ahref=http:/te
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号