zoukankan      html  css  js  c++  java
  • 自定义函数

    //跨浏览器的方法

    var leftX = (typeof screenLeft == 'number') ? screenLeft : screenX;
    var topY = (typeof screenTop == 'number') ? screenTop : screenY;

    //可视窗口的宽和高

    var width = window.innerWidth; //这里要加window,因为IE 会无效
    var height = window.innerHeight;
    if (typeof width != 'number') { //如果是IE,就使用document
    if (document.compatMode == 'CSS1Compat') {
    width = document.documentElement.clientWidth;
    height = document.documentElement.clientHeight;
    } else {
    width = document.body.clientWidth; //非标准模式使用body
    height = document.body.clientHeight;
    }
    }
    本人无商业用途,仅仅是学习做个笔记,特别鸣谢小马哥,学习了IOS,另日语学习内容有需要文本和音频请关注公众号:riyuxuexishuji
  • 相关阅读:
    前端基础之BOM和DOM
    JavaScript
    css-属性、样式调节
    计算机操作系统
    计算机组成原理
    计算机基础之编程
    css-选择器
    HTML-标签
    python打印有色字体
    mysql 数据库语法详解
  • 原文地址:https://www.cnblogs.com/laugh/p/4364067.html
Copyright © 2011-2022 走看看