教学之友,学习之友。

站长教学网

当前位置: 站长教学网 > 前端开发 > JS教程 >

jquery实现自定义风格的滚动条代码(2)

时间:2012-04-09 11:39来源:未知 作者:ken 点击:

html代码如下:

  1. <div id="smallTools" class="clearfix">   
  2. <div class="toolBox">   
  3. <div class="innerToolBox">   
  4. <ul>   
  5. <li class="tool1">   
  6. <a href="#" target="_blank">校车表</a>   
  7. </li>   
  8. <li class="tool2">   
  9. <a href="http://online.cumt.edu.cn/dzhbl/" target="_blank">电子海报</a>   
  10. </li>   
  11. <li class="tool3">   
  12. <a href="http://lib.cumt.edu.cn/" target="_blank">图书馆</a>   
  13. </li>   
  14. </ul>   
  15. <ul>   
  16. <li class="tool4">   
  17. <a href="http://stu.cumt.edu.cn/xgxt" target="_blank">学生工作系统</a>   
  18. </li>   
  19. <li class="tool5">   
  20. <a href="http://jwchu.cumt.edu.cn/" target="_blank">教务系统</a>   
  21. </li>   
  22. <li class="tool6">   
  23. <a href="http://service.js.vnet.cn/" target="_blank">网卡查询</a>   
  24. </li>   
  25. </ul>   
  26. <ul>   
  27. <li class="tool7">   
  28. <a href="http://219.219.35.66/index.php" target="_blank">自主学习</a>   
  29. </li>   
  30. <li class="tool8">   
  31. <a href="#" target="_blank">新生入口</a>   
  32. </li>   
  33. <li class="tool9">   
  34. <a href="#" target="_blank">焦点视频</a>   
  35. </li>   
  36. </ul>   
  37. <ul>   
  38. <li class="tool7">   
  39. <a href="http://219.219.35.66/index.php" target="_blank">自主学习</a>   
  40. </li>   
  41. <li class="tool8">   
  42. <a href="#" target="_blank">新生入口</a>   
  43. </li>   
  44. <li class="tool9">   
  45. <a href="#" target="_blank">焦点视频</a>   
  46. </li>   
  47. </ul>   
  48. <ul>   
  49. <li class="tool7">   
  50. <a href="http://219.219.35.66/index.php" target="_blank">自主学习</a>   
  51. </li>   
  52. <li class="tool8">   
  53. <a href="#" target="_blank">新生入口</a>   
  54. </li>   
  55. <li class="tool9">   
  56. <a href="#" target="_blank">焦点视频</a>   
  57. </li>   
  58. </ul>   
  59. </div>   
  60. </div>   
  61. <div class="slideBar">   
  62. <a href="#" class="upBtn"> </a>   
  63. <div class="barBox">   
  64. <div class="innerBar"></div>   
  65. </div>   
  66. <a href="#" class="downBtn"> </a>   
  67. </div>   
  68. <div class="clear"></div>   
  69. </div>  

 

css代码如下:

  1.  
  2. /***大框***/   
  3. #smallTools   
  4. {   
  5. background:url(../images10/smallBarBg.gif) repeat-x left bottom;   
  6. position:relative;   
  7. height:227px;   
  8. overflow:hidden;   
  9. }   
  10. /***左右两边的布局***/   
  11. #smallTools .toolBox /***左边的工具框区域***/   
  12. {   
  13. height:207px;   
  14. margin-top:10px;   
  15. float:left;   
  16. width:237px;   
  17. margin-left:10px;   
  18. overflow:hidden;   
  19. position:relative;   
  20. }   
  21. #smallTools .slideBar /***右边的滑动条区域***/   
  22. {   
  23. height:227px;   
  24. float:right;   
  25. width:11px;   
  26. }   
  27. /***左框内元素的具体样式***/   
  28. .innerToolBox   
  29. {   
  30. position:absolute;   
  31. left:0px;   
  32. top:0px;   
  33. }   
  34. #smallTools ul   
  35. {   
  36. height:69px;   
  37. }   
  38. #smallTools ul li   
  39. {   
  40. float:left;   
  41. width:79px;   
  42. height:69px;   
  43. text-align:center;   
  44. }   
  45. #smallTools ul li a   
  46. {   
  47. display:block;   
  48. width:79px;   
  49. height:22px;   
  50. padding-top:47px;   
  51. color:#000;   
  52. }   
  53. /***以下是给各工具项设置背景***/   
  54. #smallTools ul li.tool1   
  55. {   
  56. background:url(../images/tool1.gif) no-repeat center 7px   
  57. }   
  58. #smallTools ul li.tool2   
  59. {   
  60. background:url(../images/tool2.gif) no-repeat center 7px   
  61. }   
  62. #smallTools ul li.tool3   
  63. {   
  64. background:url(../images/tool3.gif) no-repeat center 7px   
  65. }   
  66. #smallTools ul li.tool4   
  67. {   
  68. background:url(../images/tool4.gif) no-repeat center 7px   
  69. }   
  70. #smallTools ul li.tool5   
  71. {   
  72. background:url(../images/tool5.gif) no-repeat center 7px   
  73. }   
  74. #smallTools ul li.tool6   
  75. {   
  76. background:url(../images/tool6.gif) no-repeat center 7px   
  77. }   
  78. #smallTools ul li.tool7   
  79. {   
  80. background:url(../images/tool7.gif) no-repeat center 7px   
  81. }   
  82. #smallTools ul li.tool8   
  83. {   
  84. background:url(../images/tool8.gif) no-repeat center 7px   
  85. }   
  86. #smallTools ul li.tool9   
  87. {   
  88. background:url(../images/tool9.gif) no-repeat center 7px   
  89. }   
  90. /***右边滑动条框的具体样式***/   
  91. .slideBar .upBtn /***向上滑动按钮***/   
  92. {   
  93. display:block;   
  94. line-height:0px;   
  95. width:9px;   
  96. height:7px;   
  97. background:url(../images/up_btn.png) no-repeat left top;   
  98. margin-top:2px;   
  99. padding:0px;   
  100. }   
  101. .slideBar .upBtn:hover   
  102. {   
  103. border:1px solid #000000;   
  104. }   
  105. .slideBar .downBtn /***向下滑动按钮***/   
  106. {   
  107. display:block;   
  108. line-height:0px;   
  109. width:9px;   
  110. height:7px;   
  111. background:url(../images/down_btn.png) no-repeat left top;   
  112. margin:0px;   
  113. padding:0px;   
  114. }   
  115. .slideBar .downBtn:hover   
  116. {   
  117. border:1px solid #000000;   
  118. }   
  119. #smallTools .barBox   
  120. {   
  121. height:196px;   
  122. margin:4px 0px;   
  123. width:11px;   
  124. position:relative;   
  125. }   
  126. .innerBar   
  127. {   
  128. position:absolute;   
  129. width:10px;   
  130. background:#a4a4a4;   
  131. cursor:s-resize;   
  132. top:0px;   
  133. }  

(责任编辑:ken)

TAG标签: jQuery 滚动条 自定义 代码 风格
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
注册登录:不允许匿名留言,登录后留言无需输入验证码。
栏目列表
最新内容