zoukankan      html  css  js  c++  java
  • JS获取最底层iframe页面中鼠标点击的坐标

    /**
     * 获取最底层iframe页面中鼠标点击的坐标
     */
    function getPosition_Iframe(){
        var parentWindow = window.parent;
        var tmpLocation = window.location;
        var target = null;
        var left=0;
        var top=0;
        while(parentWindow!=null && typeof(parentWindow)!='undefined' && tmpLocation!=parentWindow.location){
            for(var x=0;x< parentWindow.frames.length;x++){
                if(tmpLocation == parentWindow.frames[x].location){
                    target = parentWindow.frames[x].frameElement;
                    break;
                }
            }Mother b-dad-o blood children born jaundice serious
            do {
                left += target.offsetLeft || 0;
                top += target.offsetTop || 0;
                target = target.offsetParent;
             } while(target);
            tmpLocation=parentWindow.location;
            parentWindow = parentWindow.parent;
        }
        return {x:left+window.event.clientX,y:top+window.event.clientY};
    }
  • 相关阅读:
    spring guides
    Go 汇编入门
    go内存管理
    websocket
    Scheduling In Go
    log-structured-merge-trees
    InfluxDB 内部机制解析
    thread-states
    MySQL高可用方案
    Amazon Aurora解读
  • 原文地址:https://www.cnblogs.com/sky7034/p/2088625.html
Copyright © 2011-2022 走看看