SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
jQuery UI




Inbal Geffen
Installing jQuery UI


Go to : http://jqueryui.com/download/

 ● Choose all the features you want in the library (leave all)

 ● Choose a theme or design your own theme

 ● Click download

 ● Drag the js library to your project (copy)

 ● In your file add both jQuery and jQuery UI files
   <script src="js/jquery-1.8.3.js"></script>
   <script src="js/jquery-ui-1.9.2.custom.min.js"></script>


Inbal Geffen
jQuery UI Features


Interactions
Add basic mouse-based behaviors to any element.
You can create sortable lists, resizable elements, drag & drop behaviors and more with
just a few lines or code.
Interactions also make great building blocks for more complex widgets and
applications.

What kind of interactions are available?

 ●    Draggable
 ●    Droppable
 ●    Resizable
 ●    Selectable
 ●    Sortable

Inbal Geffen
Draggable
<!doctype html>
<head>
   <script src="js/jquery-1.8.3.js"></script>
   <script src="js/jquery-ui-1.9.2.custom.min.js"></script>
   <style>
   #draggable { width: 150px; height: 150px; padding: 0.5em; }
   </style>
   <script>
   $(function() {
          $( "#draggable" ).draggable();
   });
   </script>
</head>
<body>

<div id="draggable" class="ui-widget-content">
   <p>Drag me around</p>
</div>

</body>
</html>
                                                                 Inbal Geffen
Droppable
<script>
      $(function() {
             $( "#draggable" ).draggable();
             $( "#droppable" ).droppable({
                   drop: function( event, ui ) {
                          $( this )
                                 .addClass( "ui-state-highlight" )
                                 .find( "p" )
                                        .html( "Dropped!" );
                   }
             });
      });
      </script>
   </head>
   <body>
   <div id="draggable" class="ui-widget-content"><p>Drag me to my target</p></div>

  <div id="droppable" class="ui-widget-header"><p>Drop here</p></div>



                                                                                     Inbal Geffen
jQuery UI Features


Widgets

Full-featured UI controls that bring the richness of desktop applications to the Web.

 ● Accordion
 ●    Autocomplete
 ●    Button
 ●    Datepicker
 ●    Dialog
 ●    Menu
 ●    Progressbar
 ●    Slider
 ●    Spinner
 ●    Tabs
 ●    Tooltip

Inbal Geffen
Datepicker
<script>
  $(function() {
       $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>

<p>Date: <input type="text" id="datepicker" /></p>




                                                     Inbal Geffen
Datepicker2
<script>
  $(function() {
       $( "#datepicker" ).datepicker({
            numberOfMonths: 3,
            showButtonPanel: true
       });
  });
  </script>
</head>
<body>

<p>Date: <input type="text" id="datepicker" /></p>



                                                     Inbal Geffen
jQuery UI Features


Effects


 ●    Effect
 ●    Visibility
      ○ Show
      ○ Hide
      ○ Toggle
 ●    Class Animation
      ○ Add Class
      ○ Remove Class
      ○ Toggle Class
      ○ Switch Class
 ●    Color Animation


Inbal Geffen
jQuery UI Features

function runEffect() {
                  var selectedEffect = $( "#effectTypes" ).val(); //get effect type
                  var options = {};        // most effect types need no options passed by default
                  if ( selectedEffect === "scale" ) { // some effects have required parameters
                           options = { percent: 0 };
                  } else if ( selectedEffect === "transfer" ) {
                           options = { to: "#button", className: "ui-effects-transfer" };
                  } else if ( selectedEffect === "size" ) {
                           options = { to: { width: 200, height: 60 } };
                  }

                   // run the effect
                   $( "#effect" ).effect( selectedEffect, options, 500, callback );
           };

           // callback function to bring a hidden box back
           function callback() {
                    setTimeout(function() {
                           $( "#effect" ).removeAttr( "style" ).hide().fadeIn();
                    }, 1000 );
           };




                                                                                                    Inbal Geffen

Contenu connexe

Tendances

Game jump: frontend introduction #1
Game jump: frontend introduction #1Game jump: frontend introduction #1
Game jump: frontend introduction #1Sebastian Pożoga
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryRemy Sharp
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuerymanugoel2003
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuerysergioafp
 
jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Treeadamlogic
 
Drupal sins 2016 10-06
Drupal sins 2016 10-06Drupal sins 2016 10-06
Drupal sins 2016 10-06Aaron Crosman
 
Sins Against Drupal 2
Sins Against Drupal 2Sins Against Drupal 2
Sins Against Drupal 2Aaron Crosman
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitRebecca Murphey
 
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?Оксана Одариченко
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery ApplicationsRebecca Murphey
 
WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3Mizanur Rahaman Mizan
 
You're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoYou're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoChris Scott
 

Tendances (20)

Php if
Php ifPhp if
Php if
 
Dojo Confessions
Dojo ConfessionsDojo Confessions
Dojo Confessions
 
Game jump: frontend introduction #1
Game jump: frontend introduction #1Game jump: frontend introduction #1
Game jump: frontend introduction #1
 
Matters of State
Matters of StateMatters of State
Matters of State
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuery
 
jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Tree
 
Drupal sins 2016 10-06
Drupal sins 2016 10-06Drupal sins 2016 10-06
Drupal sins 2016 10-06
 
PhoneGap: Local Storage
PhoneGap: Local StoragePhoneGap: Local Storage
PhoneGap: Local Storage
 
Sins Against Drupal 2
Sins Against Drupal 2Sins Against Drupal 2
Sins Against Drupal 2
 
Keeping It Simple
Keeping It SimpleKeeping It Simple
Keeping It Simple
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
 
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
 
WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3
 
Bacbkone js
Bacbkone jsBacbkone js
Bacbkone js
 
jQuery in 15 minutes
jQuery in 15 minutesjQuery in 15 minutes
jQuery in 15 minutes
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
You're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoYou're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp Orlando
 

En vedette

En vedette (7)

J querypractice
J querypracticeJ querypractice
J querypractice
 
Jquery2
Jquery2Jquery2
Jquery2
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
 
Jquery mobile2
Jquery mobile2Jquery mobile2
Jquery mobile2
 
jQuery mobile UX
jQuery mobile UXjQuery mobile UX
jQuery mobile UX
 
Web Storage & Web Workers
Web Storage & Web WorkersWeb Storage & Web Workers
Web Storage & Web Workers
 

Similaire à J queryui

Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoRob Bontekoe
 
How to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQueryHow to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQuerykolkatageeks
 
State of jQuery and Drupal
State of jQuery and DrupalState of jQuery and Drupal
State of jQuery and Drupaljeresig
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretssmueller_sandsmedia
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and ModernizrJussi Pohjolainen
 
How to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI ComponentsHow to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI Componentscagataycivici
 
Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Jack Franklin
 

Similaire à J queryui (20)

jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
How to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQueryHow to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQuery
 
jQuery: Events, Animation, Ajax
jQuery: Events, Animation, AjaxjQuery: Events, Animation, Ajax
jQuery: Events, Animation, Ajax
 
Jquery ui
Jquery uiJquery ui
Jquery ui
 
Hooks WCSD12
Hooks WCSD12Hooks WCSD12
Hooks WCSD12
 
Prototype UI
Prototype UIPrototype UI
Prototype UI
 
State of jQuery and Drupal
State of jQuery and DrupalState of jQuery and Drupal
State of jQuery and Drupal
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
J query
J queryJ query
J query
 
jQuery Presentasion
jQuery PresentasionjQuery Presentasion
jQuery Presentasion
 
J query training
J query trainingJ query training
J query training
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
 
JQuery
JQueryJQuery
JQuery
 
How to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI ComponentsHow to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI Components
 
Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9
 
Modular and Event-Driven JavaScript
Modular and Event-Driven JavaScriptModular and Event-Driven JavaScript
Modular and Event-Driven JavaScript
 

J queryui

  • 2. Installing jQuery UI Go to : http://jqueryui.com/download/ ● Choose all the features you want in the library (leave all) ● Choose a theme or design your own theme ● Click download ● Drag the js library to your project (copy) ● In your file add both jQuery and jQuery UI files <script src="js/jquery-1.8.3.js"></script> <script src="js/jquery-ui-1.9.2.custom.min.js"></script> Inbal Geffen
  • 3. jQuery UI Features Interactions Add basic mouse-based behaviors to any element. You can create sortable lists, resizable elements, drag & drop behaviors and more with just a few lines or code. Interactions also make great building blocks for more complex widgets and applications. What kind of interactions are available? ● Draggable ● Droppable ● Resizable ● Selectable ● Sortable Inbal Geffen
  • 4. Draggable <!doctype html> <head> <script src="js/jquery-1.8.3.js"></script> <script src="js/jquery-ui-1.9.2.custom.min.js"></script> <style> #draggable { width: 150px; height: 150px; padding: 0.5em; } </style> <script> $(function() { $( "#draggable" ).draggable(); }); </script> </head> <body> <div id="draggable" class="ui-widget-content"> <p>Drag me around</p> </div> </body> </html> Inbal Geffen
  • 5. Droppable <script> $(function() { $( "#draggable" ).draggable(); $( "#droppable" ).droppable({ drop: function( event, ui ) { $( this ) .addClass( "ui-state-highlight" ) .find( "p" ) .html( "Dropped!" ); } }); }); </script> </head> <body> <div id="draggable" class="ui-widget-content"><p>Drag me to my target</p></div> <div id="droppable" class="ui-widget-header"><p>Drop here</p></div> Inbal Geffen
  • 6. jQuery UI Features Widgets Full-featured UI controls that bring the richness of desktop applications to the Web. ● Accordion ● Autocomplete ● Button ● Datepicker ● Dialog ● Menu ● Progressbar ● Slider ● Spinner ● Tabs ● Tooltip Inbal Geffen
  • 7. Datepicker <script> $(function() { $( "#datepicker" ).datepicker(); }); </script> </head> <body> <p>Date: <input type="text" id="datepicker" /></p> Inbal Geffen
  • 8. Datepicker2 <script> $(function() { $( "#datepicker" ).datepicker({ numberOfMonths: 3, showButtonPanel: true }); }); </script> </head> <body> <p>Date: <input type="text" id="datepicker" /></p> Inbal Geffen
  • 9. jQuery UI Features Effects ● Effect ● Visibility ○ Show ○ Hide ○ Toggle ● Class Animation ○ Add Class ○ Remove Class ○ Toggle Class ○ Switch Class ● Color Animation Inbal Geffen
  • 10. jQuery UI Features function runEffect() { var selectedEffect = $( "#effectTypes" ).val(); //get effect type var options = {}; // most effect types need no options passed by default if ( selectedEffect === "scale" ) { // some effects have required parameters options = { percent: 0 }; } else if ( selectedEffect === "transfer" ) { options = { to: "#button", className: "ui-effects-transfer" }; } else if ( selectedEffect === "size" ) { options = { to: { width: 200, height: 60 } }; } // run the effect $( "#effect" ).effect( selectedEffect, options, 500, callback ); }; // callback function to bring a hidden box back function callback() { setTimeout(function() { $( "#effect" ).removeAttr( "style" ).hide().fadeIn(); }, 1000 ); }; Inbal Geffen