jquery学习手记(6)CSS, Styling, & Dimensions
2013-04-18 22:19
274 查看
Css方法
// Getting CSS properties $("h1").css("fontSize"); // returns a string such as "19px" $("h1").css("font-size"); // also works // Setting CSS properties $("h1").css( "fontSize", "100px" ); // setting an individual property // setting multiple properties $("h1").css({ fontSize: "100px", color: "red" });
Styling方法
// Working with classes var $h1 = $("h1"); $h1.addClass("big"); $h1.removeClass("big"); $h1.toggleClass("big"); if ( $h1.hasClass("big") ) { ... }
Dimensions
// Basic dimensions methods // sets the width of all H1 elements $("h1").width("50px"); // gets the width of the first H1 $("h1").width(); // sets the height of all H1 elements $("h1").height("50px"); // gets the height of the first H1 $("h1").height(); // returns an object containing position // information for the first H1 relative to // its "offset (positioned) parent" $("h1").position();
相关文章推荐
- jquery学习手记(6)CSS, Styling, & Dimensions
- jQuery 学习笔记 CSS, Styling, & Dimensions
- 一步一步学习 JQuery (六) JQuery 的 html() & val() && CSS_DOM操作
- HTML+CSS+jQuery 纵向导航 && 横向导航 && 消除IE6 BUG && 感悟怎样学习
- jQuery学习——内容筛选&可见性筛选
- HTML&CSS学习5——CSS初始化
- HTML&CSS基础学习笔记1.14-创建表格
- H5学习笔记——CSS文本设置属性&颜色表示法
- Head first HTML&CSS ---[学习笔记第六章]
- jquery学习手记(1)
- HTML&CSS基础学习笔记1.23-表单的文本域和下拉列表
- [Codecademy] HTML && CSS课程学习目录
- Head first HTML&CSS ---[学习笔记第二章]
- 【整理】HTML&CSS学习
- Head First HTML & CSS chapter 8 ,9,10 :开始学习CSS, 字体和颜色设置, 盒模型
- JQuery学习笔记-JQuery的CSS DOM操作
- CSS学习笔记之<盒子模型>
- xhtml & css 简易学习笔记(三)
- CSS/JQuery元素选择器之&&和||,选择器的逻辑操作
- jQuery 学习总结