日期:2014-05-16  浏览次数:20361 次

[JavaScript][页面定位]锚的简单使用

源:http://blog.csdn.net/szwangdf/article/details/4205553

评:

?[页面定位]锚的简单使用

?

1.使用window.location.hash定位到指定的锚

?

[xhtml] view plaincopy
  1. <!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.0?Transitional//EN">??
  2. <HTML>??
  3. <HEAD>??
  4. <TITLE>?New?Document?</TITLE>??
  5. <META?NAME="Generator"?CONTENT="EditPlus">??
  6. <META?NAME="Author"?CONTENT="">??
  7. <META?NAME="Keywords"?CONTENT="">??
  8. <META?NAME="Description"?CONTENT="">??
  9. ??
  10. <mce:script?laguage="javascript"><!--??
  11. ????function?onTopClick()?{??
  12. ????????window.location.hash?=?"#top";???
  13. ????}??
  14. ????function?onBottomClick()?{??
  15. ????????window.location.hash?=?"#bottom";???
  16. ????}??
  17. //?--></mce:script>???
  18. </