zoukankan      html  css  js  c++  java
  • 脚本取得控件的绝对位置

    取得控件的绝对位置 

    //javascript 
    <script language="javascript"> 
    function getIE(e)
    var t=e.offsetTop; 
    var l=e.offsetLeft; 
    while(e=e.offsetParent)
    t
    +=e.offsetTop; 
    l
    +=e.offsetLeft; 
    }
     
    alert(
    "top="+t+"/nleft="+l); 
    }
     
    </script>

     


    / VBScript 
    <script language="VBScript"><!-- 
    function getIE() 
    dim t,l,a,b 
    set a=document.all.img1 
    t
    =document.all.img1.offsetTop 
    l
    =document.all.img1.offsetLeft 
    while a.tagName<>"BODY" 
    set a = a.offsetParent 
    t
    =t+a.offsetTop 
    l
    =l+a.offsetLeft 
    wend 
    msgbox "top="&t&chr(13)&"left="&l,64,"得到控件的位置" 
    end function 
    --></script> 

  • 相关阅读:
    ubuntu使用iso作为本地源
    ubuntu配置简单的DNS服务器
    core data
    Core Animation教程
    制作framework&静态库
    notes
    textkit
    coretext
    nsset
    iOS Development Sites
  • 原文地址:https://www.cnblogs.com/xiaowy/p/447473.html
Copyright © 2011-2022 走看看