zoukankan      html  css  js  c++  java
  • jQuery常用方法(五)-jQuery CSS

    JQuery CSS 方法说明

    css( name ) 访问第一个匹配元素的样式属性。
    css( properties ) 把一个"名/值对"对象设置为所有匹配元素的样式属性。
    $("p").hover(function () {
    $(this).css({ backgroundColor:"yellow", fontWeight:"bolder" });
    }, function () {
    var cssObj = {
    backgroundColor: “#ddd",
    fontWeight: “",
    color: “rgb(0,40,244)"
    }
    $(this).css(cssObj);
    });
    css( name, value ) 在所有匹配的元素中,设置一个样式属性的值。
    offset( ) 取得匹配的第一个元素相对于当前可视窗口的位置。返回的对象有2个属性,
    top和left,属性值为整数。这个函数只能用于可见元素。
    var p = $("p:last");
    var offset = p.offset();
    p.html( “left: " + offset.left + “, top: " + offset.top );
    width( ) 取得当前第一匹配的元素的宽度值,
    width( val ) 为每个匹配的元素设置指定的宽度值。
    height( ) 取得当前第一匹配的元素的高度值,
    height( val ) 为每个匹配的元素设置指定的高度值。

  • 相关阅读:
    uboot的mtd功能支持
    ARM920T系统总线时序分析
    NorFlash
    编译u-boot命令和u-boot常用命令
    uboot启动linux的过程
    debug(fmt,args...)调试
    APCS
    You've got to find what you love
    debian , ubuntu 截取下拉菜单
    关于bash的shellshock漏洞
  • 原文地址:https://www.cnblogs.com/ryanchancrj/p/6439437.html
Copyright © 2011-2022 走看看