HTML5的data-属性说明
Data attribute reference
The jQuery Mobile framework uses HTML5 data- attributes to allow for markup-based initialization and configuration of widgets. These attributes are completely optional; calling plugins manually and passing options directly is also supported. To avoid naming conflicts with other plugins or frameworks that also use data- attributes, set a custom namespace by modifying the ns global option.
Button
Links with data-role="button". Input-based buttons, links in toolbars and button elements are auto-enhanced, no data-role required.
data-corners true | false
data-icon home | delete | plus | arrow-u | arrow-d | check | gear | grid
| star | custom | arrow-r | arrow-l | minus | refresh | forward |
back | alert | info | search
data-iconpos left | right | top | bottom | notext
data-iconshadow true | false
data-inline true | false
data-mini true | false - Compact sized version
data-shadow true | false
data-theme swatch letter (a-z)
Multiple buttons can be wrapped in a container with a
data-role="controlgroup" attribute for a vertically grouped set. Add the data-type="horizontal" attribute for the buttons to sit side-by-side. Add the data-mini="true" to get the mini/compact sized version for all the buttons that appear in the controlgroup.
Checkbox
Pairs of labels and inputs with type="checkbox" are auto-enhanced, no data-role required
data-mini true | false - Compact sized version
data-role none - Prevents auto-enhancement to use native control data-theme swatch letter (a-z) - Added to the form element
Multiple checkboxes can be wrapped in a container with a
data-role="controlgroup" attribute for a vertically grouped set. Add the data-type="horizontal" attribute for the checkboxes to sit side-by-side. Add the data-mini="true" to get the mini/compact sized version for all the checkboxes that appear in the controlgroup.
Collapsible
A heading and content wrapped in a container with the
data-role="collapsible"
data-collapsed true | false
data-collapsed-icon home | delete | plus | arrow-u | arrow-d | check | gear |
grid | star | custom | arrow-r | arrow-l | minus | refresh |
forward | back | alert | info | search
data-content-theme swatch letter (a-z)
data-expanded-icon home | delete | plus | arrow-u | arrow-d | check | gear |
grid | star | custom | arrow-r | arrow-l | minus | refresh |
forward | back | alert | info | search
data-iconpos left | right | top | bottom
data-inset true | false
data-mini true | false - Compact sized version
data-theme swatch letter (a-z)
Collapsible set
A number of collapsibles wrapped in a container with the
data-role="collapsible-set"
data-collapsed-icon home | delete | plus | arrow-u | arrow-d | check | gear |
grid | star | custom | arrow-r | arrow-l | minus | refresh |
forward | back | alert | info | search
data-content-theme swatch letter (a-z) - Sets all collapsibles in set
data-expanded-icon home | delete | plus | arrow-u | arrow-d | check | gear |
grid | star | custom | arrow-r | arrow-l | minus | refresh |
forward | back | alert | info | search
data-iconpos left | right | top | bottom | notext
data-inset true | false
data-mini true | false - Compact sized version
data-theme swatch letter (a-z) - Sets all collapsibles in set Content
Container with data-role="content"
data-theme swatch letter (a-z)
Controlgroup
DIV or FIELDSET container with data-role="controlgroup". Visually integrate multiple button-styled inputs of a single type (checkboxes, link-based buttons, radio buttons, selects) into a group. For grouping form checkboxes and radio buttons, the fieldset container is recommended inside a div container with the data-role="fieldcontain", to improve label styling. data-mini true | false - Compact sized version for all items in the
controlgroup
data-type horizontal | vertical - For horizontal or vertical item
alignment
Dialog
Container with data-role="dialog" or linked to with
data-rel="dialog" on the anchor.
data-close-btn-text string - Text for the close button, dialog only
data-dom-cache true | false
data-overlay-theme swatch letter (a-z) - Overlay theme when the page is
opened in a dialog
data-theme swatch letter (a-z)
data-title string - Title used when page is shown Enhancement
Container with data-enhance="false" or data-ajax="false"
data-enhance true | false
data-ajax true | false
Any DOM elements inside a data-enhance="false" container, save for data-role="page|dialog" elements, will be ignored during initial enhancement and subsequent create events provided that the
$.mobile.ignoreContentEnabled flag is set prior to the enhancement (eg in a mobileinit binding).
Any link or form element inside data-ajax="false" containers will be ignored by the framework's navigation functionality when
$.mobile.ignoreContentEnabled is set to true.
Field container
Container with data-role="fieldcontain" wrapped around label/form element pair
Fixed Toolbar
Container with data-role="header" or data-role="footer" plus the attribute data-position="fixed"
data-disable-page-zoom true | false - User-scaling-ability for pages with
fixed toolbars
data-fullscreen true | false - Setting toolbars over the
page-content
data-tap-toggle true | false - Ability to toggle toolbar-visibility on
user tap/click
data-transition slide | fade | none - Show/hide-transition when a
tap/click occurs
data-update-page-padding true | false - Have the page top and bottom
padding updated on resize, transition,
"updatelayout" events (the framework always
updates the padding on the "pageshow" event). data-visible-on-page-show true | false - Toolbar-visibility when parent page
is shown
Flip toggle switch
Select with data-role="slider" and two option element
data-mini true | false - Compact sized version
data-role none - Prevents auto-enhancement to use native control data-theme swatch letter (a-z) - Added to the form element
data-track-theme swatch letter (a-z) - Added to the form element Footer
Container with data-role="footer"
data-id string - Unique ID. Required for persistent footers
data-position fixed
data-fullscreen true | false - Used in conjunction with fixed toolbars data-theme swatch letter (a-z)
Header
Container with data-role="header"
data-id string - Unique ID. Required for persistent headers
data-position fixed
data-fullscreen true | false - Used in conjunction with fixed toolbars
data-theme swatch letter (a-z)
Link
Links, including those with a data-role="button", and form submit buttons share these attributes
data-ajax true | false
data-direction reverse - Reverse transition animation (only for page or
dialog)
data-dom-cache true | false
data-prefetch true | false
data-rel back - To move one step back in history
dialog - To open link styled as dialog, not tracked in history
external - For linking to another domain
popup - For opening a popup
data-transition fade | flip | flow | pop | slide | slidedown | slidefade | slideup
| turn | none
data-position-to origin - Centers the popup over the link that opens it
jQuery selector - Centers the popup over the specified
element
window - Centers the popup in the window
Note: option only available when used with popups. See
also: popup options.
Listview
OL or UL with data-role="listview"
data-autodividers true | false
data-count-theme swatch letter (a-z) - Default "c"
data-divider-theme swatch letter (a-z) - Default "b"
data-filter true | false
data-filter-placeholder string
data-filter-theme swatch letter (a-z)
data-header-theme swatch letter (a-z)
data-inset true | false
data-split-icon home | delete | plus | arrow-u | arrow-d | check | gear
| grid | star | custom | arrow-r | arrow-l | minus |
refresh | forward | back | alert | info | search
data-split-theme swatch letter (a-z) - Default "b"
data-theme swatch letter (a-z)
Listview item
LI within a listview
data-filtertext string - Filter by this value instead of inner text
data-icon home | delete | plus | arrow-u | arrow-d | check | gear | grid
| star | custom | arrow-r | arrow-l | minus | refresh | forward |
back | alert | info | search | false
data-role list-divider
data-theme swatch letter (a-z)
The data-icon attribute is only applicable for a listview item if it contains a link.
Navbar
A number of LI s wrapped in a container with data-role="navbar"
data-iconpos left | right | top | bottom | notext
To add icons to the navbar items, the data-icon attribute is used, specifying a standard mobile icon for each item.
Navbars inherit the theme-swatch from their parent container. Setting the data-theme attribute to a navbar is not supported. The data-theme attribute can be set individually to the links inside a navbar.
Page
Container with data-role="page"
data-add-back-btn true | false - Auto add back button, header only
data-back-btn-text string
data-back-btn-theme swatch letter (a-z)
data-close-btn-text string - Text for the close button, dialog only
data-dom-cache true | false
data-fullscreen true | false - Used in conjunction with fixed toolbars
Deprecated in 1.1 - use on header and footer instead. data-overlay-theme swatch letter (a-z) - Overlay theme when the page is
opened in a dialog
data-theme swatch letter (a-z) - Default "c"
data-title string - Title used when page is shown
data-url url - Value for updating the URL, instead of the url used
to request the page
Popup
Container with data-role="popup"
data-corners true | false
data-overlay-theme swatch letter (a-z) - Default "null" (transparent
background)
data-shadow true | false
data-theme swatch letter (a-z) | none - Default inherited, "none" sets
the popup to transparent
data-tolerance 30, 15, 30, 15 - Distance from the edges of the window
(top, right, bottom, left)
Anchor with a data-rel="popup" opens the popup
data-position-to origin - Centers the popup over the link that opens it
jQuery selector - Centers the popup over the specified
element
window - Centers the popup in the window
data-rel popup - For opening a popup
data-transition fade | flip | flow | pop | slide | slidedown | slidefade | slideup
| turn | none - The transition to be used when
showing/hiding the popup
Radio button
Pairs of labels and inputs with type="radio" are auto-enhanced, no
data-role required
data-mini true | false - Compact sized version
data-role none - Prevents auto-enhancement to use native control data-theme swatch letter (a-z) - Added to the form element
Multiple radion buttons can be wrapped in a container with a
data-role="controlgroup" attribute for a vertically grouped set. Add the data-type="horizontal" attribute for the radio buttons to sit side-by-side. Add the data-mini="true" to get the mini/compact sized version for all the radio buttons that appear in the controlgroup.
Select
All select form elements are auto-enhanced, no data-role required
data-icon home | delete | plus | arrow-u | arrow-d | check | gear |
grid | star | custom | arrow-r | arrow-l | minus | refresh |
forward | back | alert | info | search | false
data-iconpos left | right | top | bottom | notext
data-inline true | false
data-mini true | false - Compact sized version
data-native-menu true | false
data-overlay-theme swatch letter (a-z) - Overlay theme for non-native selects data-placeholder true | false - Can be set on option element of a
non-native select
data-role none - Prevents auto-enhancement to use native control data-theme swatch letter (a-z) - Added to the form element Multiple selects can be wrapped in a fieldset with a
data-role="controlgroup" attribute for a vertically grouped set. Add the data-type="horizontal" attribute for the selects to sit side-by-side. Slider
Inputs with type="range" are auto-enhanced, no data-role required data-highlight true | false - Adds an active state fill on track to handle data-mini true | false - Compact sized version
data-role none - Prevents auto-enhancement to use native control data-theme swatch letter (a-z) - Added to the form element
data-track-theme swatch letter (a-z) - Added to the form element
Text input & Textarea
Input type="text|number|search|etc." or textarea elements are auto-enhanced, no data-role required
data-mini true | false - Compact sized version
data-role none - Prevents auto-enhancement to use native control data-theme swatch letter (a-z) - Added to the form element
HTML5所有标签汇总及标签意义解释
HTML5所有标签汇总及标签意义解释 HTML5所有标签汇总及标签意义解释结构标签:(块状元素) 有意义的div<article> 标记定义一篇文章 <header> 标记定义一个页面或一个区域的头部 <nav> 标记定义导航链接 <section> 标记定义一个区域 <aside> 标记定义页面内容部分的侧边栏 <hgroup> 标记定义文件中一个区块的相关信息 <figure> 标记定义一组媒体内容以及它们的标题 <figcaption> 标签定义figure 元素的标题。 <footer> 标记定义一个页面或一个区域的底部 <dialog> 标记定义一个对话框(会话框)类似微信多媒体交互标签<video> 标记定义一个视频 <audio> 标记定义音频内容 <source> 标记定义媒体资源 <canvas> 标记定义图片 <embed> 标记定义外部的可交互的内容或插件比如flashWeb应用标签<menu>命令列表 <menuitem>menu命令列表标签FF(嵌入系统) <command> menu标记定义一个命令按钮 <meter>状态标签(实时状态显示:气压、气温)C、O
<progress>状态标签(任务过程:安装、加载) C、F、O <datalist> 为input标记定义一个下拉列表,配合option F、O <details> 标记定义一个元素的详细内容,配合dt、dd C注释标签<ruby> 标记定义注释或音标 <rp> 告诉那些不支持Ruby元素的浏览器如何去显示<rt> 标记定义对ruby的注释内容文本其他标签 <keygen> 标记定义表单里一个生成的键值(加密信息传送)O、F <mark> 标记定义有标记的文本(黄色选中状态) <output> 标记定义一些输出类型,计算表单结果配合oninput事删除的HTML标签纯表现的元素: basefont,big,center,font, s,strike,tt,u;对可用性产生负面影响的元素: frame,frameset,noframes;产生混淆的元素: acronym ,applet,isindex,dir重新定义的HTML标签 <b> 代表内联文本,通常是粗体,没有传递表示重要的意思 <i> 代表内联文本,通常是斜体,没有传递表示重要的意思 <dd> 可以同details与figure一同使用,定义包含文本,dialog也可用
HTML5标签属性备忘大全
一、文字备忘之标签 HTML5中新增的标签
html标签以及属性大全
普通卷动 滑动 预设卷动 来回卷动 向下卷动 向上卷动 向右卷动 向左卷动 卷动次数 设定宽度 设定高度 设定背景颜色 设定滚动速度 设定卷动时间 鼠标经过上面时停止滚动鼠标离开时开始滚动 字体效果
...
标题字(最大)...
标题字(最小) ...粗体字 ...粗体字(强调) (同上效果略同) ...斜体字 ...斜体字(强调) ...斜体字(表示定义) ...底线 ...底线(表示插入文字)水平线
水平线(设定大小)
水平线(设定宽度)
水平线(设定颜色)
(换行)
html标签属性大全总结
html标签属性大全 html标签属性大全是朋友们整理常用的html标签,和大家更好的交流沟通。学习html标签属性大全html标签< 普通卷动 滑动 预设卷动 来回卷动 向下卷动 向上卷动 向右卷动 向左卷动 卷动次数 设定宽度 设定高度 设定背景颜色 设定滚动速度 设定卷动时间 鼠标经过上面时停止滚动 鼠标离开时开始滚动 字体效果
...
标题字(最大)...
标题字(最小) ...粗体字 ...粗体字(强调) (同上效果略同) ...斜体字 ...斜体字(强调) ...斜体字(表示定义) ...底线 ...底线(表示插入文字)水平线
HTML属性标签大全
?跑马灯 普通卷动 滑动 预设卷动 来回卷动 向下卷动 向上卷动 向右卷动 向左卷动 卷动次数 设定宽度 设定高度 设定背景颜色 设定滚动速度 设定卷动时间 鼠标经过上面时停止滚动 鼠标离开时开始滚动 ?字体效果
...
标题字(最大)...
标题字(最小)HTML5中常用的标签
HTML5中常用的标签(及标签的属性和作用) 1、标签: 作用:声明是文档中的第一成分,位于标签之前。 2、标签: 作用:此元素可告知浏览器其自身是一个HTML文档。 属性:manifest:值(url)为脱机使用定义缓存信息。 3、标签:
作用:标签用于定义文档的头部,它是所有头部元素的容器。 属性:profile:值(URL)一个有空格分隔的URL列表,这些URL包含着有关页面的 元数据信息。 4、标签:到标签 作用:-标签了定义标题。定义最大的标题,定义最小的标题。 属性:align:值(left,center,right,justify)不推荐使用。请使用样式取代它。规定标题中文本的排列。 7、标签: 作用:标签定义段落。 属性:align:值(left,center,right,justify)不推荐使用。请使用样式取代它。规定标题中文本的排列方式。 8、标签:
作用:可插入一个简单的换行符。 属性:没有可选属性。 9、标签:
作用:标签在HTML页面创建一条水平线。 属性:align:值(center,left,right)不赞成使用。请使用样式取代它。规定hr元素html标签属性大全
-标签了定义标题。定义最大的标题,定义最小的标题。 属性:align:值(left,center,right,justify)不推荐使用。请使用样式取代它。规定标题中文本的排列。 7、标签: 作用:标签定义段落。 属性:align:值(left,center,right,justify)不推荐使用。请使用样式取代它。规定标题中文本的排列方式。 8、标签:
作用:可插入一个简单的换行符。 属性:没有可选属性。 9、标签:
作用:标签在HTML页面创建一条水平线。 属性:align:值(center,left,right)不赞成使用。请使用样式取代它。规定hr元素html标签属性大全
定义最大的标题,定义最小的标题。 属性:align:值(left,center,right,justify)不推荐使用。请使用样式取代它。规定标题中文本的排列。 7、标签: 作用:标签定义段落。 属性:align:值(left,center,right,justify)不推荐使用。请使用样式取代它。规定标题中文本的排列方式。 8、标签:
作用:可插入一个简单的换行符。 属性:没有可选属性。 9、标签:
作用:标签在HTML页面创建一条水平线。 属性:align:值(center,left,right)不赞成使用。请使用样式取代它。规定hr元素html标签属性大全
作用:可插入一个简单的换行符。 属性:没有可选属性。 9、标签:
作用:标签在HTML页面创建一条水平线。 属性:align:值(center,left,right)不赞成使用。请使用样式取代它。规定hr元素
html标签属性大全
由惊风转载自互联网。跟大家分享,不需要积分! 跑马灯 普通卷动 滑动 预设卷动 来回卷动 向下卷动 向上卷动 向右卷动 向左卷动 卷动次数 设定宽度 设定高度 设定背景颜色 设定滚动速度 设定卷动时间 鼠标经过上面时停止滚动鼠标离开时开始滚动 字体效果
...
标题字(最大)...
标题字(最小) ...粗体字 ...粗体字(强调) (同上效果略同) ...斜体字 ...斜体字(强调) ...斜体字(表示定义) ...底线 ...底线(表示插入文字)水平线
水平线(设定大小)
水平线(设定宽度)
水平线(设定颜色)
HTML5参考标签及属性手册
HTML5参考标签及属性手册 window 对象触发的事件。 适用于
标签: 属性值描述 onafterprint script在打印文档之后运行脚本 onbeforeprint script在文档打印之前运行脚本 onbeforeonload script在文档加载之前运行脚本 onblur script当窗口失去焦点时运行脚本 onerror script当错误发生时运行脚本 onfocus script当窗口获得焦点时运行脚本 onhaschange script当文档改变时运行脚本 onload script当文档加载时运行脚本 onmessage script当触发消息时运行脚本 onoffline script当文档离线时运行脚本 ononline script当文档上线时运行脚本 onpagehide script当窗口隐藏时运行脚本 onpageshow script当窗口可见时运行脚本 onpopstate script当窗口历史记录改变时运行脚本 onredo script当文档执行再执行操作(redo)时运行脚本 onresize script当调整窗口大小时运行脚本 onstorage script当文档加载加载时运行脚本 onundo script当Web Storage 区域更新时(存储空间中的数据发生变化时)onunload script当用户离开文档时运行脚本 表单事件 由HTML 表单内部的动作触发的事件。 适用于所有HTML 5 元素,不过最常用于表单元素中: 属性值描述 onblur script当元素失去焦点时运行脚本新增HTML5常用标签和属性详解
新增及删除标签 一、结构标签 1.section :一个内容区域块 2.article:一块与上下文不相关的内容,如一篇文章 3.asider:article以外,与article有关的辅助信息 4.header:页面的标题 5.hgroup:对整个页面或页面中一个内容区块的标题进行组合 6.footer:脚注 7.nav:导航链接 8.figure:一块独立的内容 二、媒体标签: 1.video, video 元素支持三种视频格式: Ogg = 带有Theora 视频编码和Vorbis 音频编码的Ogg 文件 MPEG4 = 带有H.264 视频编码和AAC 音频编码的MPEG 4 文件 WebM = 带有VP8 视频编码和Vorbis 音频编码的WebM 文件 属性值描述 autoplay autoplay 如果出现该属性,则视频在就绪后马上播放。 controls controls 如果出现该属性,则向用户显示控件,比如播放按钮。 height pixels设置视频播放器的高度。 loop loop 如果出现该属性,则当媒介文件完成播放后再次开始播放。preload preload 如果出现该属性,则视频在页面加载时进行加载,并预备播放。 如果使用"autoplay",则忽略该属性。 src url要播放的视频的URL。 width pixels设置视频播放器的宽度。
HTML 常用标签属性汇总
HTML 常用标签属性汇总