| 网站首页 | 硬件维修 | 应用学院 | 网络组建 | 网站制作 | 菜鸟黑客 | 编程之道 | 数码大全 | 娱乐休闲 | 软件下载 | 在线视频 | 请您留言 | 技术论坛 | 
专 题 栏 目
最 新 热 门
最 新 推 荐
相 关 文 章
  • javascript模拟游戏中的…

  • javascript制作闪烁的边…

  • javascript设计漫天雪花

  • javascript设计网页中的…

  • 用javascript实现利用FL…

  • javascript实例教程(20)…

  • javascript实例教程(20)…

  • javascript实例教程(20)…

  • javascript实例教程(20)…

  • javascript实例教程(20)…

  • Q
    您现在的位置: 我是IT人 >> 网站制作 >> JSP >> 文章正文
    javascript制作浮动的工具条         
    javascript制作浮动的工具条
    作者:网络 文章来源:转载 点击数: 更新时间:2006-1-19
    [ 字体:缩小 正常 放大 | 双击自动滚屏 ]
    请选择合适的字体颜色:
    var dragobject = null;
    var tx;
    var ty;
    document.onmouseover = doOver;
    document.onmouseout = doOut;
    document.onmousedown = doDown;
    document.onmouseup = doUp;
    document.onmousedown=initDown;
    document.onmouseup=initUp;
    document.onmousemove=initMove;
    function stat(){
    var a = pageYOffset;
    document.bar.top = a;
    setTimeout('stat()',2);
    }
    function fix(){
    nome=navigator.appName
    if(nome=='Netscape') stat();
    else{
    var a=document.body.scrollTop;
    var b=document.body.scrollLeft;
    bar.style.top = a;
    bar.style.left = b;
    }
    }
    function getReal(el) {
    temp = el;
    while ((temp != null) && (temp.tagName != "BODY")) {
    if ((temp.className == "moveme") || (temp.className == "handle")){
    el = temp;
    return el;
    }
    temp = temp.parentElement;
    }
    return el;
    }
    function moveme_onmousedown() {
    el = getReal(window.event.srcElement)
    if (el.className == "moveme") {
    dragobject = el;
    ty = (window.event.clientY - dragobject.style.pixelTop);
    tx = (window.event.clientX - dragobject.style.pixelLeft);
    window.event.returnValue = false;
    window.event.cancelBubble = true;
    }else if (el.className == "handle") {
    tmp = el.getAttribute("for");
    if (tmp != null) {
    el = eval(tmp);
    dragobject = el;
    ty = (window.event.clientY - dragobject.style.pixelTop);
    tx = (window.event.clientX - dragobject.style.pixelLeft);
    window.event.returnValue = false;
    window.event.cancelBubble = true;
    } else {
    dragobject = null;
    }
    }else {
    dragobject = null;
    }
    }
    function moveme_onmouseup() {
    if(dragobject) {
    dragobject = null;
    }
    }
    function moveme_onmousemove() {
    if (dragobject) {
    if(window.event.clientX >= 0) {
    dragobject.style.left = window.event.clientX - tx;
    dragobject.style.top = window.event.clientY - ty;
    }
    window.event.returnValue = false;

    上一页  [1] [2] [3] [4] [5] [6] 下一页  

    文章录入:54iter    责任编辑:54iter 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 关于我们 | 友情链接 | 版权申明 |