SlideShare a Scribd company logo
1 of 10
jQuery UI - Button
         Nat
      2012/12/28
jQuery UI Button Style!
• 任何 Element 都可成為 Button Style !
  • $(element).button();

• 但要注意 Element 本身的行為
  • <a>, <input type=‘submit’ />, <input type=‘reset’ />… 等
  • 所以要做怎樣的動作來防止 !?

      $( "input[type=submit], a, input[type=reset]" ).button()
       .click(function( event ) {
        event.preventDefault();
       });
jQuery UI Button – Toggle & Buttonset
• <input type=“checkbox” />
   • Toggle 的行為




   $(container).buttonset();
jQuery UI Button – Icons
• <button>Button with two icons</button>




 primary                         secondary
Button Widget
options
• disabled with refresh
   • http://jsbin.com/utenad/2/edit
• icons with text
   • http://jsbin.com/ibopid/4/edit
• label
   • http://jsbin.com/ayikiw/1/edit
methods
• destory
   • http://jsbin.com/uzotiv/1/edit
• option, disable, enable
• refresh
• widget: Return jQuery
   • var widget = $("input").button(“widget ”);
reference
• jQuery Button
   • http://jqueryui.com/button/
   • http://api.jqueryui.com/button/


• Accessibility
   • http://
     stackoverflow.com/questions/774054/should-i-put-input-tag-inside-label-tag
   • http://www.w3.org/TR/html401/interact/forms.html#edef-LABEL
   • https://developer.mozilla.org/en-US/docs/HTML/Element/label
   • http://www.paciellogroup.com/blog/2011/07/html5-accessibility-chops-form-control
demo reference
• http://jsbin.com/utenad/2/edit - disabled with refresh
• http://jsbin.com/ibopid/4/edit - icons with text
• http://jsbin.com/ayikiw/1/edit - label
• http://jsbin.com/uzotiv/1/edit - destory

More Related Content

What's hot (10)

2013 06 04 design handbook edited
2013 06 04 design handbook edited2013 06 04 design handbook edited
2013 06 04 design handbook edited
 
Buzzient siebel-roadmap
Buzzient siebel-roadmapBuzzient siebel-roadmap
Buzzient siebel-roadmap
 
Appsplash'16 session (3) "Ui components"
Appsplash'16 session (3) "Ui components"Appsplash'16 session (3) "Ui components"
Appsplash'16 session (3) "Ui components"
 
ui-router and $state
ui-router and $stateui-router and $state
ui-router and $state
 
HTML5 and Mobile
HTML5 and MobileHTML5 and Mobile
HTML5 and Mobile
 
Marketing 1 182798-1 (1)
Marketing 1 182798-1 (1)Marketing 1 182798-1 (1)
Marketing 1 182798-1 (1)
 
Strain Letter for Kyle
Strain Letter for KyleStrain Letter for Kyle
Strain Letter for Kyle
 
Jquery
JqueryJquery
Jquery
 
Critical thinking rubric
Critical thinking rubricCritical thinking rubric
Critical thinking rubric
 
ARTDM 170 Week 3: Rollovers
ARTDM 170 Week 3: RolloversARTDM 170 Week 3: Rollovers
ARTDM 170 Week 3: Rollovers
 

Viewers also liked

HTML, CSS, JS & Jquery Introduction
HTML, CSS, JS & Jquery IntroductionHTML, CSS, JS & Jquery Introduction
HTML, CSS, JS & Jquery IntroductionIslam AlZatary
 
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery TrainingCartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery TrainingShane Church
 
jQuery with javascript training by Technnovation Labs
jQuery with javascript training by Technnovation LabsjQuery with javascript training by Technnovation Labs
jQuery with javascript training by Technnovation LabsPrasad Shende
 
Javascript jQuery jQuery Ui
Javascript jQuery jQuery UiJavascript jQuery jQuery Ui
Javascript jQuery jQuery UiTom Friedhof
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slidesmetsarin
 
HTML CSS and Web Development
HTML CSS and Web DevelopmentHTML CSS and Web Development
HTML CSS and Web DevelopmentRahul Mishra
 
HTML CSS JavaScript jQuery Training
HTML CSS JavaScript jQuery TrainingHTML CSS JavaScript jQuery Training
HTML CSS JavaScript jQuery Trainingubshreenath
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery BasicsKaloyan Kosev
 
Surveying for Widening of the Road Segment 28 Kilo to Kathmandu University
Surveying  for Widening of the Road Segment 28 Kilo to Kathmandu UniversitySurveying  for Widening of the Road Segment 28 Kilo to Kathmandu University
Surveying for Widening of the Road Segment 28 Kilo to Kathmandu UniversityUpendra Oli
 
JavaScript Basics And DOM Manipulation
JavaScript Basics And DOM ManipulationJavaScript Basics And DOM Manipulation
JavaScript Basics And DOM ManipulationSiarhei Barysiuk
 
Mapserver vs. geoserver
Mapserver vs. geoserverMapserver vs. geoserver
Mapserver vs. geoserver鸣 饶
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginningAnis Ahmad
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsCommand Prompt., Inc
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHPBradley Holt
 
OpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQLOpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQLOpen Gurukul
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1Federico Campoli
 

Viewers also liked (20)

HTML, CSS, JS & Jquery Introduction
HTML, CSS, JS & Jquery IntroductionHTML, CSS, JS & Jquery Introduction
HTML, CSS, JS & Jquery Introduction
 
jQueryUI
 jQueryUI jQueryUI
jQueryUI
 
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery TrainingCartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
 
jQuery with javascript training by Technnovation Labs
jQuery with javascript training by Technnovation LabsjQuery with javascript training by Technnovation Labs
jQuery with javascript training by Technnovation Labs
 
Javascript jQuery jQuery Ui
Javascript jQuery jQuery UiJavascript jQuery jQuery Ui
Javascript jQuery jQuery Ui
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
HTML CSS and Web Development
HTML CSS and Web DevelopmentHTML CSS and Web Development
HTML CSS and Web Development
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
 
HTML CSS JavaScript jQuery Training
HTML CSS JavaScript jQuery TrainingHTML CSS JavaScript jQuery Training
HTML CSS JavaScript jQuery Training
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery Basics
 
Surveying for Widening of the Road Segment 28 Kilo to Kathmandu University
Surveying  for Widening of the Road Segment 28 Kilo to Kathmandu UniversitySurveying  for Widening of the Road Segment 28 Kilo to Kathmandu University
Surveying for Widening of the Road Segment 28 Kilo to Kathmandu University
 
JavaScript Basics And DOM Manipulation
JavaScript Basics And DOM ManipulationJavaScript Basics And DOM Manipulation
JavaScript Basics And DOM Manipulation
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
Mapserver vs. geoserver
Mapserver vs. geoserverMapserver vs. geoserver
Mapserver vs. geoserver
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
OpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQLOpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQL
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1
 

Similar to 20121228 jqueryui - button - By Nat

jQuery Mobile Introduction ( demo on EZoapp )
jQuery Mobile Introduction ( demo on EZoapp )jQuery Mobile Introduction ( demo on EZoapp )
jQuery Mobile Introduction ( demo on EZoapp )EZoApp
 
jQuery Mobile: Progressive Enhancement with HTML5
jQuery Mobile: Progressive Enhancement with HTML5jQuery Mobile: Progressive Enhancement with HTML5
jQuery Mobile: Progressive Enhancement with HTML5Todd Anderson
 
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham SiddiquiJ Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham SiddiquiMuhammad Ehtisham Siddiqui
 
Beginning jQuery Mobile
Beginning jQuery MobileBeginning jQuery Mobile
Beginning jQuery MobileTroy Miles
 

Similar to 20121228 jqueryui - button - By Nat (6)

jQuery Mobile Introduction ( demo on EZoapp )
jQuery Mobile Introduction ( demo on EZoapp )jQuery Mobile Introduction ( demo on EZoapp )
jQuery Mobile Introduction ( demo on EZoapp )
 
jQuery Mobile: Progressive Enhancement with HTML5
jQuery Mobile: Progressive Enhancement with HTML5jQuery Mobile: Progressive Enhancement with HTML5
jQuery Mobile: Progressive Enhancement with HTML5
 
jQuery besic
jQuery besicjQuery besic
jQuery besic
 
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham SiddiquiJ Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
 
JQuery
JQueryJQuery
JQuery
 
Beginning jQuery Mobile
Beginning jQuery MobileBeginning jQuery Mobile
Beginning jQuery Mobile
 

More from LearningTech

More from LearningTech (20)

vim
vimvim
vim
 
PostCss
PostCssPostCss
PostCss
 
ReactJs
ReactJsReactJs
ReactJs
 
Docker
DockerDocker
Docker
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
 
node.js errors
node.js errorsnode.js errors
node.js errors
 
Process control nodejs
Process control nodejsProcess control nodejs
Process control nodejs
 
Expression tree
Expression treeExpression tree
Expression tree
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
 
flexbox report
flexbox reportflexbox report
flexbox report
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
 
Reflection &amp; activator
Reflection &amp; activatorReflection &amp; activator
Reflection &amp; activator
 
Peggy markdown
Peggy markdownPeggy markdown
Peggy markdown
 
Node child process
Node child processNode child process
Node child process
 
20160415ken.lee
20160415ken.lee20160415ken.lee
20160415ken.lee
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Expression tree
Expression treeExpression tree
Expression tree
 
Vic weekly learning_20160325
Vic weekly learning_20160325Vic weekly learning_20160325
Vic weekly learning_20160325
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
 
git command
git commandgit command
git command
 

20121228 jqueryui - button - By Nat

  • 1. jQuery UI - Button Nat 2012/12/28
  • 2. jQuery UI Button Style! • 任何 Element 都可成為 Button Style ! • $(element).button(); • 但要注意 Element 本身的行為 • <a>, <input type=‘submit’ />, <input type=‘reset’ />… 等 • 所以要做怎樣的動作來防止 !? $( "input[type=submit], a, input[type=reset]" ).button() .click(function( event ) { event.preventDefault(); });
  • 3. jQuery UI Button – Toggle & Buttonset • <input type=“checkbox” /> • Toggle 的行為 $(container).buttonset();
  • 4. jQuery UI Button – Icons • <button>Button with two icons</button> primary secondary
  • 6. options • disabled with refresh • http://jsbin.com/utenad/2/edit • icons with text • http://jsbin.com/ibopid/4/edit • label • http://jsbin.com/ayikiw/1/edit
  • 7. methods • destory • http://jsbin.com/uzotiv/1/edit • option, disable, enable • refresh • widget: Return jQuery • var widget = $("input").button(“widget ”);
  • 8.
  • 9. reference • jQuery Button • http://jqueryui.com/button/ • http://api.jqueryui.com/button/ • Accessibility • http:// stackoverflow.com/questions/774054/should-i-put-input-tag-inside-label-tag • http://www.w3.org/TR/html401/interact/forms.html#edef-LABEL • https://developer.mozilla.org/en-US/docs/HTML/Element/label • http://www.paciellogroup.com/blog/2011/07/html5-accessibility-chops-form-control
  • 10. demo reference • http://jsbin.com/utenad/2/edit - disabled with refresh • http://jsbin.com/ibopid/4/edit - icons with text • http://jsbin.com/ayikiw/1/edit - label • http://jsbin.com/uzotiv/1/edit - destory