zoukankan      html  css  js  c++  java
  • js各种获取当前窗口页面宽度、高度的方法

    alert($(window).height()); //浏览器时下窗口可视区域高度
    alert($(document).height()); //浏览器时下窗口文档的高度
    alert($(document.body).height());//浏览器时下窗口文档body的高度
    alert($(document.body).outerHeight(true));//浏览器时下窗口文档body的总高度 包括border padding margin
    alert($(window).width()); //浏览器时下窗口可视区域宽度
    alert($(document).width());//浏览器时下窗口文档对于象宽度
    alert($(document.body).width());//浏览器时下窗口文档body的高度
    alert($(document.body).outerWidth(true));//浏览器时下窗口文档body的总宽度 包括border padding margin
     
    alert($(document).scrollTop()); //获取滚动条到顶部的垂直高度
    alert($(document).scrollLeft()); //获取滚动条到左边的垂直宽度
  • 相关阅读:
    网页源码爬取
    Vue模板语法上集
    SSH整合
    P1290 欧几里德的游戏
    P1582 倒水
    P2158 [SDOI2008]仪仗队
    P1338 末日的传说
    P1372 又是毕业季I
    P1865 A % B Problem
    P1031 均分纸牌
  • 原文地址:https://www.cnblogs.com/shark1100913/p/6644144.html
Copyright © 2011-2022 走看看