当前位置:   article > 正文

分享 原生javaScript实现的楼层导航功能_原生的楼层

原生的楼层
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>无标题文档</title>
  6. <style>
  7. *{margin:0; padding:0;}
  8. ul,ol{list-style:none;}
  9. img {border:none;}
  10. a {text-decoration:none;}
  11. #container {position:relative;}
  12. #item-1,#item-2,#item-3,#item-4,#item-5 {color:#fff; height:300px;}
  13. #item-1 {background:#156D8E;}
  14. #item-2 {background:red;}
  15. #item-3 {background:green;}
  16. #item-4 {background:blue;}
  17. #item-5 {background:#F06;}
  18. ul {position:fixed; right:10px; top:10px;}
  19. ul li {color:#000; background:#fff; height:20px; margin-top:10px; cursor:pointer; border:1px solid #000;}
  20. ul li.active {background:red; color:#fff; border:1px solid #fff;}
  21. ul li a {line-height:20px;}
  22. </style>
  23. <script>
  24. function hasClass(obj, sCls){
  25. return obj.className.match(new RegExp("\\b"+sCls+"\\b", "i"));
  26. //match是string对象的一个方法,返回字
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/54530
推荐阅读
相关标签
  

闽ICP备14008679号