Notes on "sharp jQuery"-Four Sections, sharp jquery
Chapter 8
1. When the parent element is set to position: relative, the child element is set to position: absolute. This child element is set to any position of the parent element.
Chapter 9
1. Correct the visible area and notify the browser to use the width of the mobile device as the width of the visible area.
<Metaname = "viewport" content = "width = device-width, initial-scale = 1, user-scalable = no"/>
2. Adding the framework Sequence
<Link rel = "stylesheet" href = "css/jquery.mobile.css"/> <script type = "text/javascript" src = "js/jquery. min. js "> </script> <! -Add other js here --> <script type = "text/javascript" src = "js/jquery. mobile. js"> </script>
3. data-role = ""
1) page: page container
2) navbar: navigation bar
3) listview: List
4) header: page title container
5) footer: Page footer container
6) slider: text box with a range value
7) content: content container
8) collapsible: container of the package title and content
9) collapsible-set: the container that wraps collapsible
10) button: A link element that shares the attributes of a button.
11) fieldcontain: package container, containing the label/form Element pair
4. data-rel = "dialog": dialog Box
5. type = "checkbox/radio/text | number | search"
6. Set ul's data-inset = "true", and the width will not be 100%.
Chapter 10
1. version 1.6:
Prop indicates the dynamic state information of the element, such as the content of the dynamic output text box.
2. 1.7:
- On () replaces bind (), delegate (), live ()
- Off () replaces unbind (), undelegate (), unlive ()
3. e.tar get can capture the triggered target element.
Eg:
$(“#myTab td”).click(function(){$(this).css(‘background’,’red’);})
For example, if there are many, it will be annoying to lock
After improvement:
$(“#myTab td”).click(function(e){ var $click = e.target;$click.css(‘background’,’red’);})
4. jQuery. fu. [method name] = function (){
// Code
Return this;
}
5. Disable all animations:
jQuery.fx.off = true;
6. Switching style: toggleClass ("")