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="width: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>");
});
});
jquery------脚注的使用的更多相关文章
- 50个jQuery插件可将你的网站带到另一个高度
Web领域一直在发生变化并且其边界在过去的每一天都在发生变化(甚至不能以小时为计),随着其边界的扩展取得了许多新发展.在这些进步之中,开发者的不断工作创造了更大和更好的脚本,这些脚本以插件方式带来更好 ...
- 经典收藏 50个jQuery Mobile开发技巧集萃
http://www.cnblogs.com/chu888chu888/archive/2011/11/10/2244181.html 1.Backbone移动实例 这是在Safari中运行的一款Ba ...
- jQuery Mobile高手必备的十大技巧和代码片段
与任何新技术一样,常常难就难在如何开始入手. 有鉴于此,我们整理出了与jQuery Mobile库有关的我认为最便利的一些技巧.方法和代码片段. 由于本文不是旨在全面介绍使用jQuery Mobile ...
- (转)经典收藏 50个jQuery Mobile开发技巧集萃
(原)http://www.cnblogs.com/chu888chu888/archive/2011/11/10/2244181.html 经典收藏 50个jQuery Mobile开发技巧集萃 ...
- jquery mobile跳转到指定id时怎样传递参数
在jquery mobile 中,每一个页面都是一个page,当我们需要从一个页面跳转到另一个页面时,可以在href中指定id,可是该怎么把一个page中的参数传递到另外一个page中,几经琢磨,发现 ...
- jQuery 表格
jQuery 表格插件汇总 本文搜集了大量 jQuery 表格插件,帮助 Web 设计者更好地驾御 HTML 表格,你可以对表格进行横向和竖向排序,设置固定表头,对表格进行搜索,对大表格进行分 ...
- jQuery基础教程
1.使用$()函数 $()函数其实是创建了一个jQuery对象. 这个函数接受CSS选择符作为参数,充当一个工厂, 返回包含页面中对应元素的jQuery对象. 所有能在样式表中使用的选择符都可以传给这 ...
- 《jQuery基础教程(第四版)》学习笔记
本书代码参考:Learning jQuery Code Listing Browser 原书: jQuery基础教程 目录: 第2章 选择元素 1. 使用$()函数 2. 选择符 3. DOM遍历方法 ...
- bootstrap历练实例:面板脚注
面板脚注 我们可以在面板中添加脚注,只需要把按钮或者副文本放在带有 class .panel-footer 的 <div> 中即可.下面的实例演示了这点: <!DOCTYPE htm ...
- 小强的HTML5移动开发之路(23)—— jQuery Mobile入门
一.下载jQuery Mobile 下载地址:http://jquerymobile.com/ 点击Download 下载如下zip包 下载成功后如下图 解压目录如图: 点击index.html进入d ...
随机推荐
- C# 小型资源管理器
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- normal.1
11 # coding:utf-8 def maxnum(ipstr): ipstr = ipstr.split(' ')[1] return ipstr def minnum(ipstr): ips ...
- no.1
#import requests import urllib import bs4 try: html=urllib.urlopen('http://anyun.org') except HTTPer ...
- JS案例之6——瀑布流布局(1)
在实际的项目中,偶尔会用到一种布局——瀑布流布局.瀑布流布局的特点是,在多列布局时,可以保证内容区块在水平方向上不产生大的空隙,类似瀑布的效果.简单的说,在垂直列表里,内容区块是一个挨着一个的.当内容 ...
- Caffe学习系列(8):solver优化方法
上文提到,到目前为止,caffe总共提供了六种优化方法: Stochastic Gradient Descent (type: "SGD"), AdaDelta (type: &q ...
- 在matlab中实现遥感影像和shp文件的结合显示
clc;close all;clear; road=shaperead('boston_roads.shp'); %读取shape文件 figure, mapshow('boston.tif'); % ...
- Android -- 创建数据库到SD卡
SQLite 系统自带的SQLite是通过SQLiteOpenHelper实现的,而SQLiteOpenHelper是将数据库存储到/data/data/包名/databasas,这样做的话在没有ro ...
- Linux 基础入门 第一周9.14~9.20
第一节 Linux系统简介 Linux——操作系统 1.使多个用户从不同的终端同时操作主机(分时操作系统): 2.MINIX是一个功能有限的类似于UNIX的操作系统(UNIX 实现了 TCP/IP 协 ...
- valueOf和toString
有一道经典的题目: var add = function() {___}; console.log(add(3)(4)(5)); // 输出60 题目要求能无限相乘,请补充add函数. 首先很显然,a ...
- jTemplate —— 基于jQuery的javascript前台模版引擎
reference: http://blog.csdn.net/lexinquan/article/details/6674102 http://blog.csdn.net/kuyuyingz ...