zoukankan      html  css  js  c++  java
  • jQuery尺寸

    jQuery 尺寸

    jQuery width() 和 height() 方法

    width() 方法设置或返回元素的宽度(不包括内边距、边框或外边距)。

    height() 方法设置或返回元素的高度(不包括内边距、边框或外边距)。

    设置:$("#div1").width(300);

    获取:var h = $("#div1").height();

    jQuery innerWidth() 和 innerHeight() 方法

    innerWidth() 方法返回元素的宽度(包括内边距)。

    innerHeight() 方法返回元素的高度(包括内边距)。

    jQuery outerWidth() 和 outerHeight() 方法

    outerWidth() 方法返回元素的宽度(包括内边距和边框)。

    outerHeight() 方法返回元素的高度(包括内边距和边框)。

    注:添加参数true才包括外边距。

    $("#div1").outerWidth(400);  //设置内容+内边距+边框的总宽度为400

    $("#div1").outerWidth(400,true);  //设置内容+内边距+边框+外边距的总宽度为400

    var w = $("#div1").outerWidth(true);   //获取总宽度(包含外边距)

  • 相关阅读:
    Unity-WIKI 之 AllocationStats(内存分配)
    Unity-WIKI 之 DebugLine
    Unity-WIKI 之 DebugConsole
    Unity-WIKI 之 DrawArrow
    Unity 2D Sprite Lighting
    Unity 2D Touch Movement
    [Unity2D]2D Mobile Joystick
    DragRigidbody2D
    Finger Gestures 3.1
    2D Skeletal Animation Ready
  • 原文地址:https://www.cnblogs.com/1016391912pm/p/11927585.html
Copyright © 2011-2022 走看看