dom2

<!DOCTYPE html>
<!--
    	声明:练习素材来自于jquery基础教程
    -->
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Flatland</title>
    <link rel="stylesheet" href="../css/05.css" type="text/css" />
    <script src="../lib/jquery.js"></script>
   	<script>
   		/*复制元素*/
   		//需要使用到jQuery的.clone()的方法,该方法就相当于ctrl+c--ctrl+v
   		//例如将文章的第一段复制插入到div下
   		//如果给.clone()这个方法传递一个true则会复制当前元素的事件
   		$(document).ready(function(){
   			$('div.chapter p:eq(0)').clone().insertBefore('div.chapter');
   		});
   		
// 		$(document).ready(function(){
// 			$('span.pull-quote').each(function(index){
// 				var $parentParagraph = $(this).parent('p');
// 				$parentParagraph.css('position','relative');
// 				var $clonedCopy = $(this).clone();
// 				$clonedCopy.addClass('pulled')
// 				.prependTo($parentParagraph);
// 			});
// 		});
   		
   		/*内容setter和getter方法*/
   		$(document).ready(function(){
   			$('span.pull-quote').each(function(index){
   				var $parentParagraph = $(this).parent('p');
   				$parentParagraph.css('position','relative');
   				var $clonedCopy = $(this).clone();
   				$clonedCopy.addClass('pulled')
   				.find('span.drop')
   				.html('&hellip;')
   				.end()  //相当于返回最近的一次jQuery对象  这里就是<span clas='drop'>
   				.prependTo($parentParagraph);
   			});
   		});
   		
   		/*
   		 *移除元素
   		 * .empty()   要移除每个匹配的元素中的元素
   		 * 
   		 * 以下两个:要从文档中移除每个匹配的元素及其后代元素,但不实际删除它们
   		 * .remove()
   		 * .detach()
   		 * */
   	</script>
  </head>
  <body>
    <div id="container">
      <h1 id="f-title">Flatland: A Romance of Many Dimensions</h1>
      <div id="f-author">by Edwin A. Abbott</div>
      <h2>Part 1, Section 3</h2>
      <h3 id="f-subtitle">Concerning the Inhabitants of Flatland</h3>
      <div id="excerpt">an excerpt</div>

      <div class="chapter">
        <p class="square">Our Professional Men and Gentlemen are Squares (to which class I myself belong) and Five-Sided Figures or <a href="http://en.wikipedia.org/wiki/Pentagon">Pentagons</a>.</p>

        <p class="nobility hexagon">Next above these come the Nobility, of whom there are several degrees, beginning at Six-Sided Figures, or <a href="http://en.wikipedia.org/wiki/Hexagon">Hexagons</a>, and from thence rising in the number of their sides till they receive the honourable title of <a href="http://en.wikipedia.org/wiki/Polygon">Polygonal</a>, or many-Sided. Finally when the number of the sides becomes so numerous, and the sides themselves so small, that the figure cannot be distinguished from a <a href="http://en.wikipedia.org/wiki/Circle">circle</a>, he is included in the Circular or Priestly order; and this is the highest class of all.</p>

        <p><span class="pull-quote">It is a Law of Nature <span class="drop">with us</span> that a male child shall have <strong>one more side</strong> than his father</span>, so that each generation shall rise (as a rule) one step in the scale of development and nobility. Thus the son of a Square is a Pentagon; the son of a Pentagon, a Hexagon; and so on.</p>

        <p>But this rule applies not always to the Tradesman, and still less often to the Soldiers, and to the Workmen; who indeed can hardly be said to deserve the name of human Figures, since they have not all their sides equal. With them therefore the Law of Nature does not hold; and the son of an Isosceles (i.e. a Triangle with two sides equal) remains Isosceles still. Nevertheless, all hope is not such out, even from the Isosceles, that his posterity may ultimately rise above his degraded condition.&hellip;</p>

        <p>Rarely&mdash;in proportion to the vast numbers of Isosceles births&mdash;is a genuine and certifiable Equal-Sided Triangle produced from Isosceles parents. <span class="footnote">"What need of a certificate?" a Spaceland critic may ask: "Is not the procreation of a Square Son a certificate from Nature herself, proving the Equal-sidedness of the Father?" I reply that no Lady of any position will marry an uncertified Triangle. Square offspring has sometimes resulted from a slightly Irregular Triangle; but in almost every such case the Irregularity of the first generation is visited on the third; which either fails to attain the Pentagonal rank, or relapses to the Triangular.</span> Such a birth requires, as its antecedents, not only a series of carefully arranged intermarriages, but also a long-continued exercise of frugality and self-control on the part of the would-be ancestors of the coming Equilateral, and a patient, systematic, and continuous development of the Isosceles intellect through many generations.</p>

        <p><span class="pull-quote">The birth  of a True Equilateral Triangle from Isosceles parents is the subject of rejoicing in our country <span class="drop">for many furlongs round</span>.</span> After a strict examination conducted by the Sanitary and Social Board, the infant, if certified as Regular, is with solemn ceremonial admitted into the class of Equilaterals. He is then immediately taken from his proud yet sorrowing parents and adopted by some childless Equilateral. <span class="footnote">The Equilateral is bound by oath never to permit the child henceforth to enter his former home or so much as to look upon his relations again, for fear lest the freshly developed organism may, by force of unconscious imitation, fall back again into his hereditary level.</span></p>

        <p>How admirable is the Law of Compensation! <span class="footnote">And how perfect a proof of the natural fitness and, I may almost say, the divine origin of the aristocratic constitution of the States of Flatland!</span> By a judicious use of this Law of Nature, the Polygons and Circles are almost always able to stifle sedition in its very cradle, taking advantage of the irrepressible and boundless hopefulness of the human mind.&hellip;</p>

        <p>Then the wretched rabble of the Isosceles, planless and leaderless, are ether transfixed without resistance by the small body of their brethren whom the Chief Circle keeps in pay for emergencies of this kind; or else more often, by means of jealousies and suspicious skillfully fomented among them by the Circular party, they are stirred to mutual warfare, and perish by one another's angles. No less than one hundred and twenty rebellions are recorded in our annals, besides minor outbreaks numbered at two hundred and thirty-five; and they have all ended thus.</p>
      </div>
      <div id="footer">
        <p>Read the <a href="http://web.archive.org/web/20050208012252/http://www.ibiblio.org/eldritch/eaa/FL.HTM">complete text of <i>Flatland</i></a>.</p>
      </div>
    </div>
  </body>
</html>

 

转载于:https://my.oschina.net/Craft/blog/1585794

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值