SlideShare a Scribd company logo
jQuery 5 – jQuery UI
By- Manish Singh
Topics in This Section
• Overview
• Installation and Setup
• Widgets
– Static tabbed panels
– Ajax tabbed panels
– Accordion panels
– Date picker
– Slider
– Progress bar
Overview
• Set of rich GUI elements and effects
– Tabbed panels, slider, etc
– Effects similar to Scripaculous
– Drag and drop API
• Pros
– Official part of jQuery
– Well tested
– Very clean design
– Many still show meaningful results if JavaScript
disabled
– Theming framework
• Cons
– No autocompleter (!)
– Not as extensive as Dojo, ext/JS, or YUI
Downloading
• Download custom bundle
– http://jqueryui.com/download
– Select widgets and effects you want
– Press “Download” to download ZIP file of result
• Unzip
– Unzip result into location of your choice
• Download additional themes
– http://jqueryui.com/download
– Deselect all widgets and options, choose different theme
• You can also interactively build a customized theme
– Unzip and copy entries in “css” folder to “css” folder of
original download
• Bookmark the documentation
– http://docs.jquery.com/UI/
Installing Files
• Load normal jQuery as before
– jQuery UI download gives an additional copy in “js”
folder, so if you are using jQuery UI, one download
from jqueryui.com is sufficient
• As discussed in previous sections, it is common to
rename jQuery-1.3.x.min.js to jQuery.js to simplify
upgrades
• Copy jQuery-ui-1.7.x.custom.min.js
– E.g., copy download_folder/js/jQuery-ui-
1.7.x.custom.min.js to WebContent/scripts
– It is common to leave detailed name for this file,
since UI capabilities change from version to version
• Copy CSS “theme” folder
– E.g., copy download_folder/css/ui-lightness to
WebContent/css/
Setting Up Page: Overview
• Load required jQuery UI files
– jquery.js (renamed from jquery-
1.3.2.min.js)
– jquery-ui-1.7.1.custom.min.js
– Any custom CSS files your app uses
• Load your files that use jQuery UI
– Any custom JavaScript files your app
uses
– themename/jquery-ui-
1.7.1.custom.min.css
Setting Up Page: Example
<link rel="stylesheet“ href="./css/ui-
lightness/jquery-ui-1.7.1.custom.css“
type="text/css"/>
<link rel="stylesheet“ href="./css/sample-
styles.css“ type="text/css"/>
<script src="./scripts/jquery.js“
type="text/javascript"></script>
<script src="./scripts/jquery-ui-
1.7.1.custom.min.js“
type="text/javascript"></script>
<script src="./scripts/jquery-ui-examples.js“
type="text/javascript"></script>
Tabbed Panels with Static
Content
• Idea
– Tabbed panel where clicking tabs changes content inside
• HTML
– Make a div container to hold the tabs
• <div id="main-tabbed-panel-div">…</div>
– Include a ul list containing internal hyperlinks
• <ul>
<li><a href="#panel1">Go to Panel 1</a></li>
<li><a href="#panel2">Go to Panel 2</a></li>
</ul>
– Include divs whose ids match the href values (minus “#”)
• <div id="panel1">Content for panel 1</div>
<div id="panel2">Content for panel 2</div>
• Basic JavaScript
– Call “tabs()” on the div container
• $("#main-tabbed-panel-div").tabs();
Example: HTML
<div id="static-tabbed-panel-div">
<ul>
<li><a href="#panel1">Panel 1</a></li>
<li><a href="#panel2">Panel 2</a></li>
<li><a href="#panel3">Panel 3</a></li>
</ul>
<div id="panel1">
<p>Content for first panel.</p>
<p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p>
</div>
<div id="panel2">
<p>Content for second panel.</p>
<p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p>
</div>
<div id="panel3">
<p>Content for third panel.</p>
<p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p>
</div>
</div>
Example: JavaScript
 $(function() {
$("#static-tabbed-panel-div").tabs();
…});
Options for jQuery UI Widgets
• You can supply anonymous object
– Object has optional fields
– Fields specify configuration and
operational options
• Examples
– $("#some-id").tabs();
– $("#some-id").tabs({ option1:
"foo",option2: "bar",option3: "baz" })
Main Options for tabs({…})
• selected (default: 0)
– Tab to be selected initially
• collapsible (default: false)
– Can you click selected tab to hide it (and thus all panels)?
• $("#main-id").tabs({ collapsible: true });
• disabled (default: empty array)
–An array of tab numbers (0-based) that should be
disabled on startup
• event (default: click)
– The type of event that should initiate tab selection
• $("#main-id").tabs({ event: "mouseover" });
• fx
– Many options for specifying animation when tabs are
selected. See docs for details.
Tabbed Panels with
Dynamic (Ajax) Content
• Idea
– Tabbed panel where clicking tabs gets server content
• HTML
– Make a div container to hold the tabs
• <div id="main-tabbed-panel-div">…</div>
– Include a ul list containing external relative hyperlinks
• <ul>
<li><a href="url1">Get Content for Panel 1</a></li>
<li><a href="url2">Get Content for Panel 2</a></li>
</ul>
– That’s all!
• Basic JavaScript
– Call “tabs()” on the div container
• $("#main-tabbed-panel-div").tabs();
Example: HTML
<div id="ajax-tabbed-panel-div">
<ul>
<li><a href="time-panel.jsp">Show
Time</a></li>
<li><a href="list-panel.jsp?range=5">
Show Small Numbers</a></li>
<li><a href="list-panel.jsp?range=500">
Show Big Numbers</a></li>
</ul>
</div>
Example: JavaScript
 $(function() {
$("#ajax-tabbed-panel-
div").tabs({ collapsible: true });
…});
Example: JSP
• time-panel.jsp
<h3>It is now <%= new java.util.Date() %></h3>
Do you know where your closures are doing?
• list-panel.jsp
<% double range = 10.0;
try {
String r = request.getParameter("range");
range = Integer.parseInt(r);
} catch(Exception e) {} %>
<h3>Numbers from 0 to <%= range %></h3>
<ul>
<li><%= Math.random() * range %></li>
<li><%= Math.random() * range %></li>
<li><%= Math.random() * range %></li>
<li><%= Math.random() * range %></li>
<li><%= Math.random() * range %></li>
</ul>
Main Options for tabs({…}) for
Ajax Content
• ajaxOptions (default: {})
– Any of the options used for $.ajax in first jQuery
section
• $("#main-id").tabs({ ajaxOptions: { error:
errorHandler }});
• cache (default: false)
– Should jQuery remember content for previously-
selected
tabs? Very helpful if result is always the same for a
given
URL.
• spinner (default “<em>Loading…</em>”)
–Text to show in tab title after tab selected but before
content is received from server
Accordion Panels
• Idea
– Horizontally stacked panels with wide tabs
• HTML
– Make a div container to hold the tabs
• <div id="main-accordion-panel-div">…</div>
– Include alternating pairs of text with links and content
• <h2><a href="#">Panel 1</a></h2>
• <div>Content for Panel 1</div>
• <h2><a href="#">Panel 2</a></h2>
• <div>Content for Panel 2</div>
• Basic JavaScript
– Call “accordion()” on the div container
• $("#main-accordion-panel-div").tabs();
Example: HTML
<div id="accordion-panel-div">
<h2><a href="#">Panel 1</a></h2>
<div>
<p>Content for first panel.</p>
<p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p>
</div>
<h2><a href="#">Panel 2</a></h2>
<div>
<p>Content for second panel.</p>
<p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p>
</div>
<h2><a href="#">Panel 3</a></h2>
<div>
<p>Content for third panel.</p>
<p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p>
</div>
</div>
Example: JavaScript
 $(function() {
$("#accordion-panel-div").accordion();
…});
Main Options for accordion({…})
• active (default: 0)
– Index or selector for initially-selected item
• collapsible, event
–Can you click to hide? Event to trigger
selection.
– Same as with tabs()
• animated (default: true)
– Name of jQuery animation to use when
showing content
• $("#main-id").accordion({ animated:
"fadeIn" });
Date Picker
• Idea
– Click in textfield to pop up calendar.
Choosing day from calendar puts date string
into textfield
• HTML
– Make an input field
• <input type="text" id="date-field"/>
• Basic JavaScript
– Call “datepicker()” on the textfield
• $("#date-field").datepicker();
Example: HTML
<form action=#">
<table>
<tr><td align="right"> From: <input
type="text"/></td></tr>
<tr><td align="right">
Departure Date: <input type="text" id="start-
date"/></td></tr>
<tr><td align="right">To: <input
type="text"/></td></tr>
<tr><td align="right">
Return Date: <input type="text" id="end-
date"/></td></tr>
<tr><td align="center">
<input type="button" value="Show Flights"/>
<input type="button" value="Show Hotels"/>
</td></tr>
</table>
</form>
Example: JavaScript
 $(function() {
$("#start-date").datepicker();
$("#end-
date").datepicker({ changeMonth:
true,numberOfMonths: 2 });
…});
Main Options for
datepicker({…})
• defaultDate (default: today)
– Initially selected date
• changeMonth (default: false)
changeYear (default: false)
– Should jQuery include a dropdown list to let you
choose the month or year?
• dayNames (default Sunday…Saturday)
monthNames (default January…December)
– Names to use for the days and months. For other
languages. There are also various options for short
versions of days.
• numberOfMonths (default: 1)
– How many months to show at a time
Slider
• Idea
– Interactive slider to let user choose numeric values
• Also supports double-handled sliders for choosing ranges
• HTML
– Make a placeholder div
• <div id="div-for-slider"></div>
• Basic JavaScript
– Call “slider()” on the div, supply function to be called
when slider moves
• $("#div-for-slider").slider({ slide: sliderEventHandler });
– Look up value later
• Event handler takes two arguments: event and ui. Use
ui.value to get current slider value
Example: HTML
<form action="#">
<table>
…
<tr><td align="right">
Temperature:
</td>
<td align="left" width="300">
<div id="slider-div" style="margin-left: 10px"></div>
<div id="temp-display" align="center">32</div>
</td></tr>
<tr><td align="center" colspan="2">
<input type="button" value="Order Coffee"/>
</td></tr>
</table>
</form>
Example: JavaScript
 function showTemp(event, ui) {
$("#temp-display").html(ui.value);
}
 $(function() {
$("#slider-div").slider({ min: 32, max:
212,
slide: showTemp });
…});
Main Options for slider({…})
• min(default: 0)
– Value corresponding to left or top
• max
– Value corresponding to right or bottom
• slide
– Function to call every time value changes. Function takes
two
arguments: event and ui object. Use ui.value to get
currently
selected value.
• step (default: 1)
– Granularity of changes
• value (default: min)
– The initial value
• orientation (default: auto)
– horizontal or vertical
Progress Bar
• Idea
– Shows progress from 0% to 100%
• Output only: does not accept user input
• HTML
– Make a placeholder div
• <div id="div-for-progress-bar"></div>
• Basic JavaScript
– Call “progressbar()” on the div
• $("#div-for-progress").progressbar();
– Have another event that changes values of bar
• Look up value with
$("#div-for-progress").progressbar("option", "value");
• Change value with
$("#div-for-progress").progressbar("option", "value",
num);
Example: HTML
<form action="#">
<div id="progressbar-div"></div>
<input type="button" value="Click 10
Times"
id="progressbar-button"/>
</form>
Example: JavaScript
• function updateProgressBar() {
var currentVal =$("#progressbar-
div").progressbar("option", "value");
if (currentVal < 100) {
currentVal += 10;
$("#progressbar-div").progressbar("option",
"value",
currentVal);
}}
• $(function() {
$("#progressbar-div").progressbar();
$("#progressbar-
button").click(updateProgressBar);
…});
Summary
• Setup
– Load jquery.js, jquery-ui…js and themename/…css
• Ajax tabbed panels
– HTML
• <div id="main">
<ul><ul li><a href="relative-url-1">Panel 1</1></li>
<li><a href="relative-url-2">Panel 2</1></li>…
</ul></div>
– JavaScript
• $("#main").tabs();
• Others
– Static tabbed panels, accordion panel, date picker, slider,
progress bar
Questions??
Thank You
Email : immanish4u@gmail.com

More Related Content

What's hot

HirshHorn theme: how I created it
HirshHorn theme: how I created itHirshHorn theme: how I created it
HirshHorn theme: how I created it
Paul Bearne
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
dmethvin
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
Remy Sharp
 
A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuery
Sudar Muthu
 
jQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and BlingjQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and Bling
Doug Neiner
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
Anis Ahmad
 
Jquery-overview
Jquery-overviewJquery-overview
Jquery-overview
Isfand yar Khan
 
jQuery Basic API
jQuery Basic APIjQuery Basic API
jQuery Basic API
Hyeonseok Shin
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
manugoel2003
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
ghnash
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
Gil Fink
 
What is HTML5?
What is HTML5?What is HTML5?
What is HTML5?
Anas AbuDayah
 
jQuery
jQueryjQuery
jQuery
jQueryjQuery
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery Presentation
Rod Johnson
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
NexThoughts Technologies
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
 
Assetic (Symfony Live Paris)
Assetic (Symfony Live Paris)Assetic (Symfony Live Paris)
Assetic (Symfony Live Paris)
Kris Wallsmith
 

What's hot (20)

jQuery Presentasion
jQuery PresentasionjQuery Presentasion
jQuery Presentasion
 
HirshHorn theme: how I created it
HirshHorn theme: how I created itHirshHorn theme: how I created it
HirshHorn theme: how I created it
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuery
 
jQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and BlingjQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and Bling
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
Jquery-overview
Jquery-overviewJquery-overview
Jquery-overview
 
jQuery Basic API
jQuery Basic APIjQuery Basic API
jQuery Basic API
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
What is HTML5?
What is HTML5?What is HTML5?
What is HTML5?
 
jQuery
jQueryjQuery
jQuery
 
jQuery
jQueryjQuery
jQuery
 
Jquery
JqueryJquery
Jquery
 
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery Presentation
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
Assetic (Symfony Live Paris)
Assetic (Symfony Live Paris)Assetic (Symfony Live Paris)
Assetic (Symfony Live Paris)
 

Viewers also liked

Socket.io tech talk 06022014
Socket.io   tech talk 06022014Socket.io   tech talk 06022014
Socket.io tech talk 06022014
rifqi alfian
 
Redis for high performance application - Techtalk JDV 23-04-2014
Redis for high performance application - Techtalk JDV 23-04-2014Redis for high performance application - Techtalk JDV 23-04-2014
Redis for high performance application - Techtalk JDV 23-04-2014
rifqi alfian
 
Slide Seminar UNY, 2010 - Let's Plan Your Application
Slide Seminar UNY, 2010 - Let's Plan Your ApplicationSlide Seminar UNY, 2010 - Let's Plan Your Application
Slide Seminar UNY, 2010 - Let's Plan Your Application
rifqi alfian
 
HTML5 Google Dev Groups 2013 - Jogja Digital Valley
HTML5 Google Dev Groups 2013 - Jogja Digital ValleyHTML5 Google Dev Groups 2013 - Jogja Digital Valley
HTML5 Google Dev Groups 2013 - Jogja Digital Valley
rifqi alfian
 
6. analisis semantik
6. analisis semantik6. analisis semantik
6. analisis semantikyuster92
 
Slide NoSQL Indonesia - Redis Cache n PubSub
Slide NoSQL Indonesia - Redis Cache n  PubSubSlide NoSQL Indonesia - Redis Cache n  PubSub
Slide NoSQL Indonesia - Redis Cache n PubSub
rifqi alfian
 

Viewers also liked (6)

Socket.io tech talk 06022014
Socket.io   tech talk 06022014Socket.io   tech talk 06022014
Socket.io tech talk 06022014
 
Redis for high performance application - Techtalk JDV 23-04-2014
Redis for high performance application - Techtalk JDV 23-04-2014Redis for high performance application - Techtalk JDV 23-04-2014
Redis for high performance application - Techtalk JDV 23-04-2014
 
Slide Seminar UNY, 2010 - Let's Plan Your Application
Slide Seminar UNY, 2010 - Let's Plan Your ApplicationSlide Seminar UNY, 2010 - Let's Plan Your Application
Slide Seminar UNY, 2010 - Let's Plan Your Application
 
HTML5 Google Dev Groups 2013 - Jogja Digital Valley
HTML5 Google Dev Groups 2013 - Jogja Digital ValleyHTML5 Google Dev Groups 2013 - Jogja Digital Valley
HTML5 Google Dev Groups 2013 - Jogja Digital Valley
 
6. analisis semantik
6. analisis semantik6. analisis semantik
6. analisis semantik
 
Slide NoSQL Indonesia - Redis Cache n PubSub
Slide NoSQL Indonesia - Redis Cache n  PubSubSlide NoSQL Indonesia - Redis Cache n  PubSub
Slide NoSQL Indonesia - Redis Cache n PubSub
 

Similar to Jquery 5

Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap
Rakesh Jha
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
Doris Chen
 
Yuihacku iitd-sumana
Yuihacku iitd-sumanaYuihacku iitd-sumana
Yuihacku iitd-sumana
Sumana Hariharan
 
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
crokitta
 
SharePointfest Denver - A jQuery Primer for SharePoint
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePoint
Marc D Anderson
 
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
Rob Bontekoe
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2James Pearce
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
Mark Rackley
 
Introduction to jquery mobile with Phonegap
Introduction to jquery mobile with PhonegapIntroduction to jquery mobile with Phonegap
Introduction to jquery mobile with Phonegap
Rakesh Jha
 
Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
Christian Rokitta
 
J query
J queryJ query
J query
Manav Prasad
 
SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuery
Mark Rackley
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
Dave Artz
 
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
Mark Rackley
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateInventis Web Architects
 

Similar to Jquery 5 (20)

Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Yuihacku iitd-sumana
Yuihacku iitd-sumanaYuihacku iitd-sumana
Yuihacku iitd-sumana
 
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
 
J query module1
J query module1J query module1
J query module1
 
SharePointfest Denver - A jQuery Primer for SharePoint
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePoint
 
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
 
JQuery
JQueryJQuery
JQuery
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
 
Introduction to jquery mobile with Phonegap
Introduction to jquery mobile with PhonegapIntroduction to jquery mobile with Phonegap
Introduction to jquery mobile with Phonegap
 
Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
 
J query
J queryJ query
J query
 
SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuery
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-template
 
JQuery
JQueryJQuery
JQuery
 
JQuery
JQueryJQuery
JQuery
 

Recently uploaded

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 

Recently uploaded (20)

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 

Jquery 5

  • 1. jQuery 5 – jQuery UI By- Manish Singh
  • 2. Topics in This Section • Overview • Installation and Setup • Widgets – Static tabbed panels – Ajax tabbed panels – Accordion panels – Date picker – Slider – Progress bar
  • 3. Overview • Set of rich GUI elements and effects – Tabbed panels, slider, etc – Effects similar to Scripaculous – Drag and drop API • Pros – Official part of jQuery – Well tested – Very clean design – Many still show meaningful results if JavaScript disabled – Theming framework • Cons – No autocompleter (!) – Not as extensive as Dojo, ext/JS, or YUI
  • 4. Downloading • Download custom bundle – http://jqueryui.com/download – Select widgets and effects you want – Press “Download” to download ZIP file of result • Unzip – Unzip result into location of your choice • Download additional themes – http://jqueryui.com/download – Deselect all widgets and options, choose different theme • You can also interactively build a customized theme – Unzip and copy entries in “css” folder to “css” folder of original download • Bookmark the documentation – http://docs.jquery.com/UI/
  • 5. Installing Files • Load normal jQuery as before – jQuery UI download gives an additional copy in “js” folder, so if you are using jQuery UI, one download from jqueryui.com is sufficient • As discussed in previous sections, it is common to rename jQuery-1.3.x.min.js to jQuery.js to simplify upgrades • Copy jQuery-ui-1.7.x.custom.min.js – E.g., copy download_folder/js/jQuery-ui- 1.7.x.custom.min.js to WebContent/scripts – It is common to leave detailed name for this file, since UI capabilities change from version to version • Copy CSS “theme” folder – E.g., copy download_folder/css/ui-lightness to WebContent/css/
  • 6. Setting Up Page: Overview • Load required jQuery UI files – jquery.js (renamed from jquery- 1.3.2.min.js) – jquery-ui-1.7.1.custom.min.js – Any custom CSS files your app uses • Load your files that use jQuery UI – Any custom JavaScript files your app uses – themename/jquery-ui- 1.7.1.custom.min.css
  • 7. Setting Up Page: Example <link rel="stylesheet“ href="./css/ui- lightness/jquery-ui-1.7.1.custom.css“ type="text/css"/> <link rel="stylesheet“ href="./css/sample- styles.css“ type="text/css"/> <script src="./scripts/jquery.js“ type="text/javascript"></script> <script src="./scripts/jquery-ui- 1.7.1.custom.min.js“ type="text/javascript"></script> <script src="./scripts/jquery-ui-examples.js“ type="text/javascript"></script>
  • 8. Tabbed Panels with Static Content • Idea – Tabbed panel where clicking tabs changes content inside • HTML – Make a div container to hold the tabs • <div id="main-tabbed-panel-div">…</div> – Include a ul list containing internal hyperlinks • <ul> <li><a href="#panel1">Go to Panel 1</a></li> <li><a href="#panel2">Go to Panel 2</a></li> </ul> – Include divs whose ids match the href values (minus “#”) • <div id="panel1">Content for panel 1</div> <div id="panel2">Content for panel 2</div> • Basic JavaScript – Call “tabs()” on the div container • $("#main-tabbed-panel-div").tabs();
  • 9. Example: HTML <div id="static-tabbed-panel-div"> <ul> <li><a href="#panel1">Panel 1</a></li> <li><a href="#panel2">Panel 2</a></li> <li><a href="#panel3">Panel 3</a></li> </ul> <div id="panel1"> <p>Content for first panel.</p> <p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p> </div> <div id="panel2"> <p>Content for second panel.</p> <p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p> </div> <div id="panel3"> <p>Content for third panel.</p> <p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p> </div> </div>
  • 10. Example: JavaScript  $(function() { $("#static-tabbed-panel-div").tabs(); …});
  • 11. Options for jQuery UI Widgets • You can supply anonymous object – Object has optional fields – Fields specify configuration and operational options • Examples – $("#some-id").tabs(); – $("#some-id").tabs({ option1: "foo",option2: "bar",option3: "baz" })
  • 12. Main Options for tabs({…}) • selected (default: 0) – Tab to be selected initially • collapsible (default: false) – Can you click selected tab to hide it (and thus all panels)? • $("#main-id").tabs({ collapsible: true }); • disabled (default: empty array) –An array of tab numbers (0-based) that should be disabled on startup • event (default: click) – The type of event that should initiate tab selection • $("#main-id").tabs({ event: "mouseover" }); • fx – Many options for specifying animation when tabs are selected. See docs for details.
  • 13. Tabbed Panels with Dynamic (Ajax) Content • Idea – Tabbed panel where clicking tabs gets server content • HTML – Make a div container to hold the tabs • <div id="main-tabbed-panel-div">…</div> – Include a ul list containing external relative hyperlinks • <ul> <li><a href="url1">Get Content for Panel 1</a></li> <li><a href="url2">Get Content for Panel 2</a></li> </ul> – That’s all! • Basic JavaScript – Call “tabs()” on the div container • $("#main-tabbed-panel-div").tabs();
  • 14. Example: HTML <div id="ajax-tabbed-panel-div"> <ul> <li><a href="time-panel.jsp">Show Time</a></li> <li><a href="list-panel.jsp?range=5"> Show Small Numbers</a></li> <li><a href="list-panel.jsp?range=500"> Show Big Numbers</a></li> </ul> </div>
  • 15. Example: JavaScript  $(function() { $("#ajax-tabbed-panel- div").tabs({ collapsible: true }); …});
  • 16. Example: JSP • time-panel.jsp <h3>It is now <%= new java.util.Date() %></h3> Do you know where your closures are doing? • list-panel.jsp <% double range = 10.0; try { String r = request.getParameter("range"); range = Integer.parseInt(r); } catch(Exception e) {} %> <h3>Numbers from 0 to <%= range %></h3> <ul> <li><%= Math.random() * range %></li> <li><%= Math.random() * range %></li> <li><%= Math.random() * range %></li> <li><%= Math.random() * range %></li> <li><%= Math.random() * range %></li> </ul>
  • 17. Main Options for tabs({…}) for Ajax Content • ajaxOptions (default: {}) – Any of the options used for $.ajax in first jQuery section • $("#main-id").tabs({ ajaxOptions: { error: errorHandler }}); • cache (default: false) – Should jQuery remember content for previously- selected tabs? Very helpful if result is always the same for a given URL. • spinner (default “<em>Loading…</em>”) –Text to show in tab title after tab selected but before content is received from server
  • 18. Accordion Panels • Idea – Horizontally stacked panels with wide tabs • HTML – Make a div container to hold the tabs • <div id="main-accordion-panel-div">…</div> – Include alternating pairs of text with links and content • <h2><a href="#">Panel 1</a></h2> • <div>Content for Panel 1</div> • <h2><a href="#">Panel 2</a></h2> • <div>Content for Panel 2</div> • Basic JavaScript – Call “accordion()” on the div container • $("#main-accordion-panel-div").tabs();
  • 19. Example: HTML <div id="accordion-panel-div"> <h2><a href="#">Panel 1</a></h2> <div> <p>Content for first panel.</p> <p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p> </div> <h2><a href="#">Panel 2</a></h2> <div> <p>Content for second panel.</p> <p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p> </div> <h2><a href="#">Panel 3</a></h2> <div> <p>Content for third panel.</p> <p>Foo, bar, baz.</p><p>Yadda, yadda, yadda.</p> </div> </div>
  • 20. Example: JavaScript  $(function() { $("#accordion-panel-div").accordion(); …});
  • 21. Main Options for accordion({…}) • active (default: 0) – Index or selector for initially-selected item • collapsible, event –Can you click to hide? Event to trigger selection. – Same as with tabs() • animated (default: true) – Name of jQuery animation to use when showing content • $("#main-id").accordion({ animated: "fadeIn" });
  • 22. Date Picker • Idea – Click in textfield to pop up calendar. Choosing day from calendar puts date string into textfield • HTML – Make an input field • <input type="text" id="date-field"/> • Basic JavaScript – Call “datepicker()” on the textfield • $("#date-field").datepicker();
  • 23. Example: HTML <form action=#"> <table> <tr><td align="right"> From: <input type="text"/></td></tr> <tr><td align="right"> Departure Date: <input type="text" id="start- date"/></td></tr> <tr><td align="right">To: <input type="text"/></td></tr> <tr><td align="right"> Return Date: <input type="text" id="end- date"/></td></tr> <tr><td align="center"> <input type="button" value="Show Flights"/> <input type="button" value="Show Hotels"/> </td></tr> </table> </form>
  • 24. Example: JavaScript  $(function() { $("#start-date").datepicker(); $("#end- date").datepicker({ changeMonth: true,numberOfMonths: 2 }); …});
  • 25. Main Options for datepicker({…}) • defaultDate (default: today) – Initially selected date • changeMonth (default: false) changeYear (default: false) – Should jQuery include a dropdown list to let you choose the month or year? • dayNames (default Sunday…Saturday) monthNames (default January…December) – Names to use for the days and months. For other languages. There are also various options for short versions of days. • numberOfMonths (default: 1) – How many months to show at a time
  • 26. Slider • Idea – Interactive slider to let user choose numeric values • Also supports double-handled sliders for choosing ranges • HTML – Make a placeholder div • <div id="div-for-slider"></div> • Basic JavaScript – Call “slider()” on the div, supply function to be called when slider moves • $("#div-for-slider").slider({ slide: sliderEventHandler }); – Look up value later • Event handler takes two arguments: event and ui. Use ui.value to get current slider value
  • 27. Example: HTML <form action="#"> <table> … <tr><td align="right"> Temperature: </td> <td align="left" width="300"> <div id="slider-div" style="margin-left: 10px"></div> <div id="temp-display" align="center">32</div> </td></tr> <tr><td align="center" colspan="2"> <input type="button" value="Order Coffee"/> </td></tr> </table> </form>
  • 28. Example: JavaScript  function showTemp(event, ui) { $("#temp-display").html(ui.value); }  $(function() { $("#slider-div").slider({ min: 32, max: 212, slide: showTemp }); …});
  • 29. Main Options for slider({…}) • min(default: 0) – Value corresponding to left or top • max – Value corresponding to right or bottom • slide – Function to call every time value changes. Function takes two arguments: event and ui object. Use ui.value to get currently selected value. • step (default: 1) – Granularity of changes • value (default: min) – The initial value • orientation (default: auto) – horizontal or vertical
  • 30. Progress Bar • Idea – Shows progress from 0% to 100% • Output only: does not accept user input • HTML – Make a placeholder div • <div id="div-for-progress-bar"></div> • Basic JavaScript – Call “progressbar()” on the div • $("#div-for-progress").progressbar(); – Have another event that changes values of bar • Look up value with $("#div-for-progress").progressbar("option", "value"); • Change value with $("#div-for-progress").progressbar("option", "value", num);
  • 31. Example: HTML <form action="#"> <div id="progressbar-div"></div> <input type="button" value="Click 10 Times" id="progressbar-button"/> </form>
  • 32. Example: JavaScript • function updateProgressBar() { var currentVal =$("#progressbar- div").progressbar("option", "value"); if (currentVal < 100) { currentVal += 10; $("#progressbar-div").progressbar("option", "value", currentVal); }} • $(function() { $("#progressbar-div").progressbar(); $("#progressbar- button").click(updateProgressBar); …});
  • 33. Summary • Setup – Load jquery.js, jquery-ui…js and themename/…css • Ajax tabbed panels – HTML • <div id="main"> <ul><ul li><a href="relative-url-1">Panel 1</1></li> <li><a href="relative-url-2">Panel 2</1></li>… </ul></div> – JavaScript • $("#main").tabs(); • Others – Static tabbed panels, accordion panel, date picker, slider, progress bar
  • 35. Thank You Email : immanish4u@gmail.com