• jquery------脚注的使用


    index.jsp

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

    <
    div id="chapter"> <p>How admirable is the Law of Compensation!<span id="footnote">today is Monday!</span><span class="pull">A wonderful day!</span></p> <p>And how perfect a proof of the natural fitness!<span id="footnote">today is Friday!</span>I believe you!</p> <p>Next above these come the Nobility<span id="drop">,of Whom there are!</span><span id="footnote">today is Saturday!</span>If you work hard,you will succeed!</p> </div> <div style="500px;height:500px;"></div> <a href="#top" style="display:block;margin:0px;padding:0px">back to top</a> <div id="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(""))   //反向插入
                    .append(["<a href='#context-",
                             index+1,
                             "'>context</a>"].join(""))
                    .appendTo($note)
                    .wrap("<li id='footnote-"+(index+1)+"'></li>");
            });
    });
  • 相关阅读:
    Cocos2d-x之物理世界(创建悬浮的物体)
    Cocos2d-x之物理世界(创建静态的物体)
    Cocos2d-x之物理世界(创建运动的物体)
    cocos2d-x之Node移除HelloWorld节点
    IFNULL NULLIF ISNULL
    表格导出
    random模块
    Echarts
    "==" 与 "is"的区别
    angular
  • 原文地址:https://www.cnblogs.com/tianhengblogs/p/5481022.html
Copyright © 2020-2023  润新知