Article Introduction: This article gives us a deep understanding of the jquery Mobile Checkboxradio plugin. |
This article gives us a deep understanding of the jquery mobile Checkboxradio plugin
The radio and checkbox in the form depend on it for initialization enhancements and the binding of some events (disable, enable, checked, unchecked), etc.
1, disable (disabled)
Example:
Disable $ ("#disable_checkbox"). Bind (' click ', Function () { $ ("#major_eng"). Checkboxradio ("Disable");
2, enable (enabled)
Example:
Enable $ ("#enable_checkbox"). Bind (' click ', Function () { $ ("#major_eng"). Checkboxradio ("Enable");
3, checked (selected)
Example:
Select $ ("#checked_checkbox"). Bind (' click ', Function () { $ ("#major_eng"). attr ("Checked", true). Checkboxradio ("Refresh");
4, unchecked (not selected)
Example:
Do not select $ (' #unchecked_checkbox '). Bind (' click ', Function () { $ ("#major_eng"). attr ("checked", false). Checkboxradio ("Refresh");
5, dynamic creation
Example:
Dynamically create $ ("#unchecked_checkbox"). Bind (' click ', Function () { //Once Oh if ($ ("#dynamic_checkbox_group"). length < 1) { var arr = [ ' ', ' < Legend> front-end basic Technology: ', ' js "," css (default selected) ', ' ' ]; $ (Arr.join ("")). InsertAfter ("#major_group"); You can set the subject: $ ("#fe_css"). Checkboxradio ({ theme: "E" }) //Trigger Create $. Mobile.pageContainer.trigger ("create"); } });
Demo