Use of footnotes------jquery

Source: Internet
Author: User

index.jsp

<script type= "Text/javascript" src= ". /js/my.js "></script>

<DivID= "chapter"> <P>How admirable are the law of compensation!<spanID= "footnote">Today is monday!</span><spanclass= "Pull">A Wonderful day!</span></P> <P>And how perfect a proof of the natural fitness!<spanID= "footnote">Today is friday!</span>I believe you!</P> <P>Next above these come the nobility<spanID= "Drop">, of Whom there are!</span><spanID= "footnote">Today is saturday!</span>If you work hard,you'll succeed!</P> </Div> <Divstyle= "width:500px;height:500px;"></Div> <ahref= "#top"style= "display:block;margin:0px;padding:0px">Back to Top</a> <DivID= "Footer"></Div>

My.js

$ (document). Ready ({var$note =$ ("<ol></ol>"). InsertBefore ("#footer"); $("Span#footnote"). each (function(Index) {$ ( This). before (["<a href= ' #footnote--", Index+1,                         "' Id= ' context-", Index+1,                         "' class= ' context ' > ',                         "<sup style= ' font-size:15px ' >", Index+1,                         "</sup></a>"].join (""))//Reverse Insert. append (["<a href= ' #context-", Index+1,                         "' >context</a>"].join ("" ") . AppendTo ($note). Wrap ("<li id= ' footnote-" + (index+1) + "></li>"); });});

Use of footnotes------jquery

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.