asfman
android developer
posts - 90,  comments - 213,  trackbacks - 0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<style type="text/css">
#bg{background: url(7689827.gif) no-repeat; position: relative; width: 676px; height: 23px;}
#slidebar{position: relative; left: 28px; top: 4px; width: 10px; cursor: pointer}
</style>
</head>
<body>
<div id="bg">
      <div id="slidebar"><img onselectstart="return false" unselectable="on" align="absmiddle" src="7689824.gif" /></div>
</div>
<div id="show">

</div>
<script type="text/javascript">
<!--
    var o = document.getElementById("slidebar");
    o.onmousedown = function(e){
      e = e || window.event;
      /*record the screenX and left pos*/
      var screenX = e.screenX, s = parseInt(o.style.left)||28;
      document.onmousemove = function(e2){
        e2 = e2 || window.event;
        diffX = e2.screenX - screenX;
        var ret = s + diffX ;
        /*limit pos*/
        if(ret > 638) ret = 638;
        if(ret < 28) ret = 28;
        o.style.left = ret + "px";
        document.getElementById("show").innerHTML = ret;
        return false;
      }
      document.onmouseup = function(){
        document.onmousemove = null;
        document.onmouseup = null;
      }
      if(e.preventDefault){
          this.style.MozUserSelect = 'none'
         e.preventDefault();
      }
    }
//-->
</script>
</body>
</html>
posted on 2009-01-19 13:26 汪杰 阅读(264) 评论(1)  编辑 收藏 引用 所属分类: javascript

FeedBack:
只有注册用户登录后才能发表评论。

<2024年11月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(15)

随笔分类(1)

随笔档案(90)

文章分类(727)

文章档案(712)

相册

收藏夹

http://blog.csdn.net/prodigynonsense

友情链接

最新随笔

搜索

  •  

积分与排名

  • 积分 - 467490
  • 排名 - 6

最新随笔

最新评论

阅读排行榜

评论排行榜