[b]jQuery CSS 函数[/b]
jQuery 拥有三种供 CSS 操作的重要函数:
$(selector).css(name,value)
$(selector).css({properties})
$(selector).css(name)
[b]CSS 操作实例[/b]
函数 css(name,value) 为所有匹配元素的给定 CSS 属性设置值:
实例
函数 css({properties}) 同时为所有匹配元素的一系列 CSS 属性设置值:
实例
函数 css(name) 返回指定的 CSS 属性的值:
实例
[b]jQuery Size 操作[/b]
jQuery 拥有两种供尺寸操作的重要函数:
$(selector).height(value)
$(selector).width(value)
Size 操作实例
函数 height(value) 设置所有匹配元素的高度:
实例
函数 width(value) 设置所有匹配元素的宽度:
实例
[b]jQuery CSS 函数 - 来自本页[/b]
$(selector).css(name,value) 为匹配元素设置样式属性的值
$(selector).css({properties}) 为匹配元素设置多个样式属性
$(selector).css(name) 获得第一个匹配元素的样式属性值
$(selector).height(value) 设置匹配元素的高度
$(selector).width(value) 设置匹配元素的宽度
更多css函数参考手册:jQuery CSS 函数参考手册 [url]http://www.w3school.com.cn/jquery/jquery_ref_css.asp[/url]
jQuery 拥有三种供 CSS 操作的重要函数:
$(selector).css(name,value)
$(selector).css({properties})
$(selector).css(name)
[b]CSS 操作实例[/b]
函数 css(name,value) 为所有匹配元素的给定 CSS 属性设置值:
实例
$(selector).css(name,value)
$("p").css("background-color","yellow");
函数 css({properties}) 同时为所有匹配元素的一系列 CSS 属性设置值:
实例
$(selector).css({properties})
$("p").css({"background-color":"yellow","font-size":"200%"});
函数 css(name) 返回指定的 CSS 属性的值:
实例
$(selector).css(name)
$(this).css("background-color");
[b]jQuery Size 操作[/b]
jQuery 拥有两种供尺寸操作的重要函数:
$(selector).height(value)
$(selector).width(value)
Size 操作实例
函数 height(value) 设置所有匹配元素的高度:
实例
$(selector).height(value)
$("#id100").height("200px");
函数 width(value) 设置所有匹配元素的宽度:
实例
$(selector).width(value)
$("#id200").width("300px");
[b]jQuery CSS 函数 - 来自本页[/b]
$(selector).css(name,value) 为匹配元素设置样式属性的值
$(selector).css({properties}) 为匹配元素设置多个样式属性
$(selector).css(name) 获得第一个匹配元素的样式属性值
$(selector).height(value) 设置匹配元素的高度
$(selector).width(value) 设置匹配元素的宽度
更多css函数参考手册:jQuery CSS 函数参考手册 [url]http://www.w3school.com.cn/jquery/jquery_ref_css.asp[/url]