« 经典韩国网页模板资源发布一些免费的网络U盘网 »

给页面添加脚注功能

FontSize:- + Date: 2006年3月13日
摘要:

利用javascript&css实现脚注功能,在公司企业站点,计划说明,注释等相关页面十分适用,简洁,大方,方便实用。

资料来源:网络文/佚名

Having read Daring Fireball's post on footnotes in blogs, I thought it shouldn't be that difficult to come up with a css/javascript solution.

Here's the result.

There are two divs, "content" and "footnotes". "Content" holds the content, "footnotes" is empty. The footnotes are added in-line in span tags (with class="footnote“) within the content.

When the button is clicked, the javascript function looks for spans with class "footnote" in the "content" div. It then swaps the text in the span for a superscripted link, and places the footnote in a div within the "footnote" div.

Normally, the function would be called onLoad.

The function can be called for multiple content and footnote divs.

Advantages:

  • You don't have to worry about numbering, for one thing.
  • The footnotes can be edited at their insertion point.
  • You could give users the choice of how footnotes are formatted, or whether they are shown at all.

Disadvantages:

  • Without Javascript, footnotes are left in-line.

Tested on a Mac (Firefox/Safari) and a PC (Firefox/Explorer6).


提示:您可以先修改部分代码再运行

 

原文地址:www.brandspankingnew.net

效果演示地址:http://www.brandspankingnew.net/specials/footnote.html

版权声明:本文属转载作品,版权属原作者所有。

本文链接地址:http://www.demoseo.com/DemoSeo/Footnotes-with-Javascript&CSS.html
如果你也喜欢本文,记得顶一下,支持我。你的支持是我继续发好文章的最大动力!谢谢!

« 经典韩国网页模板资源发布一些免费的网络U盘网 »
土豆网视频推荐
Get TrackBack URI 发布:DemoSeo | 分类:web技术 | 评论:3 | 引用:0 | 浏览:
Tags:优化功能  js  css  网页特效  国外资源  
Share:

Other Articles

Comments

  1. [Quote] [Reply] 1 DemoSeo Said,
  2. [Mail]2008-1-14 15:18:25
  3. 比较实用的功能,如果不能浏览,可点进入原文件网址,效果可见。Z-blog没有提供代码运行功能,Leafor正在修改中。
  1. [Quote] [Reply] 2 密陀僧 Said,
  2. [Mail]2008-1-14 21:37:26
  3. 貌似你已经修改成功了
    leafor 于 08-01-18 17:44:52 回复
    还是没有哦,都换成字符了,还有,没有换行……
  1. [Quote] [Reply] 3 密陀僧 Said,
  2. [Mail]2008-1-18 20:36:51
  3. If Instr(para,"[space]")>0 Then source=Replace(source," "," ")

    这句代码注释掉了吗?

    注意,修改后文章内容中的代码部分重新编辑一下。
    leafor 于 08-01-19 00:25:03 回复
    解决了,我是在html编辑模式下写[code][/code]的,所以会出错。我直接在ubb代码下写,就可以了。谢谢啦。

Leave a Comment

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。