»
Tiếng AnhTiếng PhápTiếng Việt

In - Tạo một thanh trượt - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Linh tinh » Tạo một thanh trượt
URL: https://www.javascriptbank.com/sliders-x-slider.html

Tạo một thanh trượt © JavaScriptBank.comHiệu ứng sẽ tạo một thanh trượt cho một vùng được chỉ định trên trang web.

Phiên bản đầy đủ: jsB@nk » Linh tinh » Tạo một thanh trượt
URL: https://www.javascriptbank.com/sliders-x-slider.html



CSS
<link href="/v3.css"><style type="text/css">.clsX {  position:absolute; visibility:hidden;  width:100%; height:100%; clip:rect(0,100%,100%,0);  color:#000000; margin:0px; padding:0px;  border:1px solid #000000;}</style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script type="text/javascript" src="x_load.js"></script><script type="text/javascript">if (xInclude('../x_core.js', '../x_event.js', '../x_drag.js')) {  window.onload = winOnLoad;}function winOnLoad() {  var s = xGetElementById('slider');  xBackground(s, '#963');  xResizeTo(s, 24, 400);  var lc = xGetElementById('firstLeftContent');  xMoveTo(s, xPageX(lc) + xWidth(lc) - (xWidth(s)/2), xPageY(lc));  xShow(s);  var t = xGetElementById('thumb');  xBackground(t, '#330');  xResizeTo(t, 20, 20);  xMoveTo(t, 1, 1);  xShow(t);  xEnableDrag(t, null, thumbOnDrag, null);}function thumbOnDrag(e, mdx, mdy) {  var newY = xTop(e) + mdy;  if (newY >= 1 && newY < xHeight(xParent(e)) - xHeight(e) - 3) {    xTop(e, xTop(e) + mdy);  }}</script><script type="text/javascript" src="x_core.js"></script><script type="text/javascript" src="x_event.js"></script><script type="text/javascript" src="x_drag.js"></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<div id="slider" class="clsX" style="background-color: rgb(153, 102, 51); width: 22px; height: 398px; left: 717px; top: 20px; visibility: visible;">  <div id="thumb" class="clsX" style="background-color: rgb(51, 51, 0); width: 18px; height: 18px; left: 1px; visibility: visible; top: 64px;"></div></div><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


Files
http://javascriptbank.com/javascript/misc/Sliders/v3.csshttp://javascriptbank.com/javascript/misc/Sliders/x_load.jshttp://javascriptbank.com/javascript/misc/Sliders/x_core.jshttp://javascriptbank.com/javascript/misc/Sliders/x_event.jshttp://javascriptbank.com/javascript/misc/Sliders/x_drag.js