###################### #### ------> Directory ###################### #### ------> Files: C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter02\firstindex.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter02\secondindex.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter03\example1-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter03\example1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\countdown-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\countdown.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\date.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\esc.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\example1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\isnan.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\pi.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\regex.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\render-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\render.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\scope1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\scoping-fixed.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\scoping.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\teststring.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\writingthedate-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\writingthedate.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\compound.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\deleteop1-orig.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\deleteop1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\equality.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\equality2.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\typeof.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\dowhile.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\foreach.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\forinloop.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\forloop.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\form1example-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\form1example.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\ifexample-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\ifexample.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\ifexample2.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\ifexample3.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\myexample.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter07\arguments.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter07\confirm-complete.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter07\confirm.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter07\listing7-1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter07\listing7-2.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\aststring.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\concat-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\concat-orig.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\concat.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\concat2-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\encode.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\foreach.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\numsort.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\proploop-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\proploop.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\sort.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\starstring.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\history.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\javatest-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\javatest.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\location1-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\location1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\location2-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\location2.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\location3.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\naviprops-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\naviprops.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\screen-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\screen.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter10\librarypage.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter10\CompletedCode\librarypage.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\docready-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\docready.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\listing11-1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\listing11-2.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\listing11-3.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\listing11-4.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\create.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\createid-jquery.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\createid.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\del-jquery.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\del.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\example1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\example2.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\getbyid-jquery.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\getbyid.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\getbytag-jquery.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\getbytag.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\setattrib-jquery.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\setattrib.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\showattribs-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\showattribs.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter13\example13-2.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter13\example13-3.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter13\example13-4.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter13\example13-5.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter13\useragent.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\hover1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\listing14-1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\nightsky-im.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\nightsky.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\hover\hover-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\hover\hover-jquery.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\hover\hover.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\preload\hover.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\preload-js\hover.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\slideshow\slideshow.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\slideshow-js\slide-prev.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\slideshow-js\slideshow-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\slideshow-js\slideshow.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\example1-jquery.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\example1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\pizza-checkbox-js.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\pizza-checkbox.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\pizza-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\pizza-radio.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\pizza.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\selectbox.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\validating\grass-inline.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\validating\grass.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\css1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\css2-jq.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\css2.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\example16-3-jq.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\example16-3.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\form-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\form.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\cal-custom.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\cal-ex1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\cal.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\dialog-open.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\dialog.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\test-complete.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\test.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\collapsible.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\custom-icons.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\fillspace.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\hoverintent.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\mouseover.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\no-auto-height.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\sortable.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\addClass\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\addClass\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\animate\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\animate\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\categories.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\combobox.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\custom-data.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\folding.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\maxheight.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\multiple-remote.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\multiple.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\remote-jsonp.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\remote-with-cache.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\remote.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\xml.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\checkbox.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\icons.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\radio.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\splitbutton.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\toolbar.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\alt-field.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\animation.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\buttonbar.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\date-formats.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\date-range.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\dropdown-month-year.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\icon-trigger.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\inline.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\localization.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\min-max.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\multiple-calendars.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\other-months.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\show-week.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\animated.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\modal-confirmation.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\modal-form.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\modal-message.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\modal.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\constrain-movement.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\cursor-style.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\delay-start.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\handle.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\revert.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\scroll.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\snap-to.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\sortable.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\visual-feedback.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\accepted-elements.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\photo-manager.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\propagation.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\revert.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\shopping-cart.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\visual-feedback.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\effect\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\effect\easing.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\effect\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\hide\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\hide\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\position\cycler.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\position\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\position\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\progressbar\animated.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\progressbar\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\progressbar\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\progressbar\resize.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\removeClass\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\removeClass\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\animate.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\aspect-ratio.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\constrain-area.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\delay-start.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\helper.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\max-min.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\snap-to-grid.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\synchronous-resize.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\textarea.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\visual-feedback.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\selectable\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\selectable\display-grid.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\selectable\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\selectable\serialize.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\show\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\show\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\colorpicker.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\hotelrooms.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\multiple-vertical.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\range-vertical.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\range.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\rangemax.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\rangemin.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\side-scroll.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\slider-vertical.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\steps.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\tabs.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\connect-lists-through-tabs.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\connect-lists.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\delay-start.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\display-grid.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\empty-lists.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\items.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\placeholder.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\portlets.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\switchClass\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\switchClass\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\ajax.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\bottom.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\collapsible.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\cookie.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\manipulation.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\mouseover.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\sortable.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\vertical.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\ajax\content1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\ajax\content2.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\toggle\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\toggle\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\toggleClass\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\toggleClass\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\accordion.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\addClass.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\animate.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\autocomplete.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\button.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\datepicker.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\dialog.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\draggable.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\droppable.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\effect.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\hide.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\position.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\progressbar.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\removeClass.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\resizable.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\selectable.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\show.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\slider.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\sortable.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\switchClass.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\tabs.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\toggle.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\toggleClass.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\footerbar.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\footerbarb.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\headerbutton.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\link.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\links.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\navbar.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\pers-active.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\pers-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\pers.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\test-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\test.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\themee.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\nav.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\accessibility.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\features.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\getting-started.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\intro.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\platforms.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\data-attributes.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\events-nav.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\globalconfig.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\mediahelpers.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\themes.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\api-buttons.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-grouped.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-icons.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-inline.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-themes.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-types.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\dialogTransition.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\iOSFullscreen.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\jq17b1.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\loadingMessage.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\loadingMessageTextVisible.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\minScrollBack.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\pageLoadErrorMessage.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\pageTransition.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\pushState.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\touchOverflow.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\api-content.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-set-events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-set-methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-set-options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-set.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-grids.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-html.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-themes.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\docs-forms.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-all-compare.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-all-mini.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-all-native.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-all.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-sample.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-themes.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\plugin-eventsmethods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\checkboxes\events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\checkboxes\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\checkboxes\methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\checkboxes\options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\radiobuttons\events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\radiobuttons\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\radiobuttons\methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\radiobuttons\options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\search\events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\search\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\search\methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\search\options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\selects\custom.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\selects\events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\selects\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\selects\methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\selects\options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\slider\events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\slider\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\slider\methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\slider\options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\switch\events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\switch\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\switch\methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\switch\options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\textinputs\events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\textinputs\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\textinputs\methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\textinputs\options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\docs-lists.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-all-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-count.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-divider.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-formatting.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-forms-inset.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-forms.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-icons.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-inset.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-nested.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-ol.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-performance.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-readonly-inset.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-readonly.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-search-filtertext.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-search-inset.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-search-with-dividers.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-search.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-split-purchase.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-split.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-themes.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-thumbnails.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-ul.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog-alt.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog-buttons.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog-overlay.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog-success.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog-with-select.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\multipage-template.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-anatomy.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-cache.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-customtransitions.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-dialogs.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-dynamic.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-links.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-navmodel.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-scripting.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-template.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-titles.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-transitions-dialog.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-transitions-flash-workaround.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-transitions-page.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-transitions.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\phonegap.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\touchoverflow.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\transition-success.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\docs-links-urltest\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\animals.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\colors.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\sample-reuse-page-external.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\sample-reuse-page.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\vehicles.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes\theme-a.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes\theme-b.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes\theme-c.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes\theme-d.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes\theme-e.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-events.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-a.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-b.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-c.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-d.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-e.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-f.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-g.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-h.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-methods.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-options.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fullscreen.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-themes.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\docs-bars.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\docs-footers.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\docs-headers.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\docs-navbar.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\footer-persist-a.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\footer-persist-b.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\footer-persist-c.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\footer-persist-d.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\index.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter20\ajax.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter20\isbn-full.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter20\isbn.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\bin\Debug\AppX\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\bin\Debug\AppX\pages\items\items.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\bin\Debug\AppX\pages\split\split.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\pages\items\items.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\pages\split\split.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\bin\Debug\AppX\default.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\bin\Debug\AppX\pages\items\items.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\bin\Debug\AppX\pages\split\split.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\pages\items\items.html C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\pages\split\split.html ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter02\firstindex.html My First Page ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter02\secondindex.html My First Page ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter03\example1-full.html A Chapter 3 Example ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter03\example1.html A Chapter 3 Example ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\countdown-full.html the date

 

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\countdown.html the date

 

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\date.html Date ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\esc.html Escaping ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\example1.html Hexadecimal Numbers ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\isnan.html isNan ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\pi.html Regex ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\regex.html Regex ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\render-full.html the date

 

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\render.html the date

 

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\scope1.html Scope ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\scoping-fixed.html Scoping Example ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\scoping.html Scoping Example ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\teststring.html String Testing ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\writingthedate-full.html the date

 

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter04\writingthedate.html the date

 

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\compound.html Compound ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\deleteop1-orig.html The Delete Operator ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\deleteop1.html The Delete Operator ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\equality.html Equality ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\equality2.html Equality ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter05\typeof.html The Typeof Example ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\dowhile.html Do While ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\foreach.html For Each In Loop Example ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\forinloop.html For In Loop Example ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\forloop.html For Loop Example ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\form1example-full.html Just Your Basic Form

Username:

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\form1example.html Just Your Basic Form

Username:

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\ifexample-full.html An If Example

This is an example from Chapter 6.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\ifexample.html An If Example

This is an example from Chapter 6.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\ifexample2.html An If Example

This is an example from Chapter 6.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\ifexample3.html An If Example

This is an example from Chapter 6.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter06\myexample.html A Multi-Level Example

This is an example from Chapter 6.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter07\arguments.html Arguments Array ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter07\confirm-complete.html Confirming Something ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter07\confirm.html Confirming Something ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter07\listing7-1.html Return Value ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter07\listing7-2.html Order Fruit ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\aststring.html Join ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\concat-full.html Concat ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\concat-orig.html Concat ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\concat.html Concat ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\concat2-full.html Concat ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\encode.html Encode ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\foreach.html Foreach ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\numsort.html Number Sort ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\proploop-full.html Properties ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\proploop.html Properties ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\sort.html Sort ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter08\starstring.html Join ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\history.html History

Click to go back

Click to go forward

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\javatest-full.html Java Test ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\javatest.html Java Test ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\location1-full.html Location, Location, Location ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\location1.html Location, Location, Location ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\location2-full.html Location, Location, Location ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\location2.html Location, Location, Location ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\location3.html Location, Location, Location ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\naviprops-full.html The navigator Object ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\naviprops.html The navigator Object ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\screen-full.html Screen ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter09\screen.html Screen ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter10\librarypage.html A Basic Example ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter10\CompletedCode\librarypage.html A Basic Example ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\docready-full.html Document Ready ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\docready.html Document Ready ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\listing11-1.html Adding jQuery ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\listing11-2.html Table Test
Row 1 Column 1 of the table Row 1 Column 2 of the table
Row 2 Column 1 of the table Row 2 Column 2 of the table
Row 3 Column 1 of the table Row 3 Column 2 of the table
Row 4 Column 1 of the table Row 4 Column 2 of the table
Row 5 Column 1 of the table Row 5 Column 2 of the table
Row 6 Column 1 of the table Row 6 Column 2 of the table
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\listing11-3.html Iteration Test
Team Name W-L Record Win Percentage
Team 1 12-8 .600
Team 5 11-9 .550
Team 4 10-10 .500
Team 2 9-11 .450
Team 6 6-14 .300
Team 3 2-18 .100
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter11\listing11-4.html Iteration Test
Team Name W-L Record Win Percentage
Team 1 12-8 .600
Team 5 11-9 .550
Team 4 10-10 .500
Team 2 9-11 .450
Team 6 6-14 .300
Team 3 2-18 .100
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\create.html Create ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\createid-jquery.html Create ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\createid.html Create ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\del-jquery.html Del ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\del.html Del ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\example1.html Hello World

Here's some text.

Here's more text.

Link to the W3

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\example2.html Get By Id

Here's some text.

Here's more text.

Link to the W3

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\getbyid-jquery.html Get By Id

Here's some text.

Here's more text.

Link to the W3

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\getbyid.html Get By Id

Here's some text.

Here's more text.

Link to the W3

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\getbytag-jquery.html Tag Name
Left columnRight column
Left columnRight column
Left columnRight column
Click to Change Colors ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\getbytag.html Tag Name
Left columnRight column
Left columnRight column
Left columnRight column
Click to Change Colors ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\setattrib-jquery.html Set Attrib Steve Suehring's Web Site ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\setattrib.html Set Attrib Steve Suehring's Web Site ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\showattribs-full.html Show Attribs Steve Suehring's Web Site ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter12\showattribs.html Show Attribs Steve Suehring's Web Site ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter13\example13-2.html Trigger Test
Here is some text.
It goes inside this div

Steve Suehring

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter13\example13-3.html timer

Hello

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter13\example13-4.html timer

Hello

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter13\example13-5.html Trigger Test
Here is some text.
It goes inside this div

Steve Suehring

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter13\useragent.html user agent ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\hover1.html hover example Home ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\listing14-1.html hover example Home ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\nightsky-im.html Night Sky

The Night Sky

Ursa Minor Draco Draco Draco Draco Cassiopeia

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\nightsky.html Night Sky

The Night Sky

Ursa Minor Draco Draco Draco Draco Cassiopeia

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\hover\hover-full.html hover exercise Home
Blog
About
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\hover\hover-jquery.html hover regular expression Home
Blog
About

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\hover\hover.html hover exercise Home
Blog
About
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\preload\hover.html hover regular expression Home
Blog
About

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\preload-js\hover.html Rollover

Home

About

Blog

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\slideshow\slideshow.html Slideshow

Home

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\slideshow-js\slide-prev.html Slideshow

Home

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\slideshow-js\slideshow-full.html Slideshow

Home

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter14\slideshow-js\slideshow.html Slideshow

Home

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\example1-jquery.html A Basic Example

A Basic Form Example

Name (Required):

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\example1.html A Basic Example

A Basic Form Example

Name (Required):

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\pizza-checkbox-js.html Pizza

Toppings:

Sausage
Pepperoni
Ham
Green Peppers
Mushrooms
Onions
Pineapple

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\pizza-checkbox.html Pizza

Toppings:

Sausage
Pepperoni
Ham
Green Peppers
Mushrooms
Onions
Pineapple

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\pizza-full.html Pizza

Main Topping:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\pizza-radio.html Pizza
ToppingsCrust
Sausage Regular
Pepperoni Deep Dish
Ham Thin
Green Peppers
Mushrooms
Onions
Pineapple

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\pizza.html Pizza

Main Topping:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\selectbox.html A Select Example

A Basic Select Example

Select A Constellation:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\validating\grass-inline.html Catalog Example

Order Blades of Grass From Steve Suehring's Lawn

steve suehring's lawn is dead

Description: Steve is terrible at lawn care, therefore there's not much grass on his lawn. Quantities are extremely limited.

Price: $100.00 per blade

Quantity to order (Limit 3 per Household):

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter15\validating\grass.html Catalog Example

Order Blades of Grass From Steve Suehring's Lawn

steve suehring's lawn is dead

Description: Steve is terrible at lawn care, therefore there's not much grass on his lawn. Quantities are extremely limited.

Price: $100.00 per blade

Quantity to order (Limit 3 per Household):

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\css1.html JavaScript Step by Step

JavaScript Step by Step

JavaScript Step by Step is a book by Steve Suehring, published by Microsoft Press.

The book emphasizes standards-based JavaScript that works on multiple platforms through different browsers.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\css2-jq.html JavaScript Step by Step

JavaScript Step by Step

JavaScript Step by Step is a book by Steve Suehring, published by Microsoft Press.

The book emphasizes standards-based JavaScript that works on multiple platforms through different browsers.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\css2.html JavaScript Step by Step

JavaScript Step by Step

JavaScript Step by Step is a book by Steve Suehring, published by Microsoft Press.

The book emphasizes standards-based JavaScript that works on multiple platforms through different browsers.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\example16-3-jq.html JavaScript Step by Step

JavaScript Step by Step

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\example16-3.html JavaScript Step by Step

JavaScript Step by Step

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\form-full.html Form Validation
City:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter16\form.html Form Validation
City:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\cal-custom.html jQuery UI Datepicker
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\cal-ex1.html jQuery UI Datepicker
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\cal.html jQuery UI Datepicker
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\dialog-open.html jQuery UI Dialog
Click here to open the dialog

Here's a dialog

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\dialog.html jQuery UI Dialog

Here's a dialog

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\index.html jQuery UI Example Page

Welcome to jQuery UI!

This page demonstrates the widgets you downloaded using the theme you selected in the download builder. We've included and linked to minified versions of jQuery, your personalized copy of jQuery UI (js/jquery-ui-1.8.22.custom.min.js), and css/ui-lightness/jquery-ui-1.8.22.custom.css which imports the entire jQuery UI CSS Framework. You can choose to link a subset of the CSS Framework depending on your needs.

You've downloaded components and a theme that are compatible with jQuery 1.3+. Please make sure you are using jQuery 1.3+ in your production environment.

YOUR COMPONENTS:

Accordion

First

Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.

Second

Phasellus mattis tincidunt nibh.

Third

Nam dui erat, auctor a, dignissim quis.

Autocomplete

Button

Tabs

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.
Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.

Dialog

Open Dialog

Overlay and Shadow Classes (not currently used in UI widgets)

Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat.

Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci.

Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat.

Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam.

Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante.

Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Framework Icons (content color preview)

Slider

Datepicker

Progressbar

Highlight / Error

Hey! Sample ui-state-highlight style.


Alert: Sample ui-state-error style.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\test-complete.html jQuery UI Test Page
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\test.html jQuery UI Test Page
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\index.html jQuery UI Demos
Interactions
Draggable
Droppable
Resizable
Selectable
Sortable
Widgets
Accordion
Autocomplete
Button
Datepicker
Dialog
Progressbar
Slider
Tabs
Effects
Color Animation
Toggle Class
Add Class
Remove Class
Switch Class
Effect
Toggle
Hide
Show
Utilities
Position
Widget
About jQuery UI
Getting Started
Upgrade Guide
Changelog
Roadmap
Subversion Access
UI Developer Guidelines
Theming
Theming jQuery UI
jQuery UI CSS Framework
ThemeRoller application
Theme Switcher Widget

Instructions

These demos showcase some common uses of each jQuery UI plugin. Simply copy and paste code from the demos to get started. Have fun playing with them.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\collapsible.html jQuery UI Accordion - Collapse content

Section 1

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

Section 3

Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

  • List item one
  • List item two
  • List item three

Section 4

Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

By default, accordions always keep one section open. To allow for all sections to be be collapsible, set the collapsible option to true. Click on the currently open section to collapse its content pane.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\custom-icons.html jQuery UI Accordion - Customize icons

Section 1

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

Section 3

Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

  • List item one
  • List item two
  • List item three

Section 4

Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

Customize the header icons with the icons option, which accepts classes for the header's default and selected (open) state. Use any class from the UI CSS framework, or create custom classes with background images.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\default.html jQuery UI Accordion - Default functionality

Section 1

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

Section 3

Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

  • List item one
  • List item two
  • List item three

Section 4

Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

Click headers to expand/collapse content that is broken into logical sections, much like tabs. Optionally, toggle sections open/closed on mouseover.

The underlying HTML markup is a series of headers (H3 tags) and content divs so the content is usable without JavaScript.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\fillspace.html jQuery UI Accordion - Fill space

Resize the outer container:

Section 1

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

Section 3

Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

  • List item one
  • List item two
  • List item three

Section 4

Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

I'm another panel

Because the accordion is comprised of block-level elements, by default its width fills the available horizontal space. To fill the vertical space allocated by its container, set the boolean fillSpace option to true, and the script will automatically set the dimensions of the accordion to the height of its parent container. The accordion will also resize with its container if the container is resizable.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\hoverintent.html jQuery UI Accordion - Open on hoverintent

Section 1

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

Section 3

Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

  • List item one
  • List item two
  • List item three

Section 4

Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

Click headers to expand/collapse content that is broken into logical sections, much like tabs. Optionally, toggle sections open/closed on mouseover.

The underlying HTML markup is a series of headers (H3 tags) and content divs so the content is usable without JavaScript.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\index.html jQuery UI Accordion Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\mouseover.html jQuery UI Accordion - Open on mouseover

Section 1

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

Section 3

Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

  • List item one
  • List item two
  • List item three

Section 4

Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

Toggle sections open/closed on mouseover with the event option. The default value for event is "click."

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\no-auto-height.html jQuery UI Accordion - No auto height

Section 1

Mauris mauris ante, blandit et, ultrices a, susceros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

Section 3

Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

  • List item
  • List item
  • List item
  • List item
  • List item
  • List item
  • List item
Link to other content

Setting autoHeight: false allows to accordion panels to keep their native height.

In addition, the navigation option is enabled, opening the panel based on the current location, eg. no-auto-height.html#panel2 would open the second panel on page load. It also finds anchors within the content, so #othercontent will open the third section, as it contains a link with that href.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\accordion\sortable.html jQuery UI Accordion - Sortable

Section 1

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

Section 3

Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

  • List item one
  • List item two
  • List item three

Section 4

Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

Drag the header to re-order panels.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\addClass\default.html jQuery UI Effects - addClass demo
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede.
Run Effect

This demo adds a class which animates: text-indent, letter-spacing, width, height, padding, margin, and font-size.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\addClass\index.html jQuery UI Effects Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\animate\default.html jQuery UI Effects - Animate demo

Animate

Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.

Toggle Effect

Click the button above to preview the effect.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\animate\index.html jQuery UI Effects Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\categories.html jQuery UI Autocomplete - Categories

A categorized search result. Try typing "a" or "n".

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\combobox.html jQuery UI Autocomplete - Combobox

A custom widget built by composition of Autocomplete and Button. You can either type something into the field to get filtered suggestions based on your input, or use the button to get the full list of selections.

The input is read from an existing select-element for progressive enhancement, passed to Autocomplete with a customized source-option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\custom-data.html jQuery UI Autocomplete - Custom data and display
Select a project (type "j" for a start):

You can use your own custom data formats and displays by simply overriding the default focus and select actions.

Try typing "j" to get a list of projects or just press the down arrow.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\default.html jQuery UI Autocomplete - Default functionality

The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are tags for programming languages, give "ja" (for Java or JavaScript) a try.

The datasource is a simple JavaScript array, provided to the widget using the source-option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\folding.html jQuery UI Autocomplete - Accent folding

The autocomplete field uses a custom source option which will match results that have accented characters even when the text field doesn't contain accented characters. However if the you type in accented characters in the text field it is smart enough not to show results that aren't accented.

Try typing "Jo" to see "John" and "Jörn", then type "Jö" to see only "Jörn".

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\index.html jQuery UI Autocomplete Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\maxheight.html jQuery UI Autocomplete - Scrollable results

When displaying a long list of options, you can simply set the max-height for the autocomplete menu to prevent the menu from growing too large. Try typing "a" or "s" above to get a long list of results that you can scroll through.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\multiple-remote.html jQuery UI Autocomplete - Multiple, remote

Usage: Enter at least two characters to get bird name suggestions. Select a value to continue adding more names.

This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\multiple.html jQuery UI Autocomplete - Multiple values

Usage: Type something, eg. "j" to see suggestions for tagging with programming languages. Select a value, then continue typing to add more.

This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\remote-jsonp.html jQuery UI Autocomplete - Remote JSONP datasource
Powered by geonames.org
Result:

The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are cities, displayed when at least two characters are entered into the field.

In this case, the datasource is the geonames.org webservice. While only the city name itself ends up in the input after selecting an element, more info is displayed in the suggestions to help find the right entry. That data is also available in callbacks, as illustrated by the Result area below the input.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\remote-with-cache.html jQuery UI Autocomplete - Remote with caching

The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are bird names, displayed when at least two characters are entered into the field.

Similar to the remote datasource demo, though this adds some local caching to improve performance. The cache here saves just one query, and could be extended to cache multiple values, one for each term.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\remote.html jQuery UI Autocomplete - Remote datasource
Result:

The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are bird names, displayed when at least two characters are entered into the field.

The datasource is a server-side script which returns JSON data, specified via a simple URL for the source-option. In addition, the minLength-option is set to 2 to avoid queries that would return too many results and the select-event is used to display some feedback.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\autocomplete\xml.html jQuery UI Autocomplete - XML data parsed once
Result:

This demo shows how to retrieve some XML data, parse it using jQuery's methods, then provide it to the autocomplete as the datasource.

This should also serve as a reference on how to parse a remote XML datasource - the parsing would just happen for each request within the source-callback.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\checkbox.html jQuery UI Button - Checkboxes

A checkbox is styled as a toggle button with the button widget. The label element associated with the checkbox is used for the button text.

This demo also demonstrates three checkboxes styled as a button set by calling .buttonset() on a common container.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\default.html jQuery UI Button - Default functionality
An anchor

Examples of the markup that can be used for buttons: A button element, an input of type submit and an anchor.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\icons.html jQuery UI Button - Icons

Some buttons with various combinations of text and icons, here specified via metadata.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\index.html jQuery UI Button Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\radio.html jQuery UI Button - Radios

A set of three radio buttons transformed into a button set.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\splitbutton.html jQuery UI Button - Split button

An example of a split button built with two buttons: A plan button with just text, one with only a primary icon and no text. Both are grouped together in a set.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\button\toolbar.html jQuery UI Button - Toolbar

A mediaplayer toolbar. Take a look at the underlying markup: A few button elements, an input of type checkbox for the Shuffle button, and three inputs of type radio for the Repeat options.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\alt-field.html jQuery UI Datepicker - Populate alternate field

Date:  

Populate an alternate field with its own date format whenever a date is selected using the altField and altFormat options. This feature could be used to present a human-friendly date for user selection, while passing a more computer-friendly date through for further processing.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\animation.html jQuery UI Datepicker - Animations

Date:

Animations:

Use different animations when opening or closing the datepicker. Choose an animation from the dropdown, then click on the input to see its effect. You can use one of the three standard animations or any of the UI Effects.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\buttonbar.html jQuery UI Datepicker - Display button bar

Date:

Display a button for selecting Today's date and a Done button for closing the calendar with the boolean showButtonPanel option. Each button is enabled by default when the bar is displayed, but can be turned off with additional options. Button text is customizable.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\date-formats.html jQuery UI Datepicker - Format date

Date:

Format options:

Display date feedback in a variety of ways. Choose a date format from the dropdown, then click on the input and select a date to see it in that format.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\date-range.html jQuery UI Datepicker - Select a Date Range

Select the date range to search for.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\default.html jQuery UI Datepicker - Default functionality

Date:

The datepicker is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay. Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\dropdown-month-year.html jQuery UI Datepicker - Display month & year menus

Date:

Show month and year dropdowns in place of the static month/year header to facilitate navigation through large timeframes. Add the boolean changeMonth and changeYear options.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\icon-trigger.html jQuery UI Datepicker - Icon trigger

Date:

Click the icon next to the input field to show the datepicker. Set the datepicker to open on focus (default behavior), on icon click, or both.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\index.html jQuery UI Datepicker Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\inline.html jQuery UI Datepicker - Display inline
Date:

Display the datepicker embedded in the page instead of in an overlay. Simply call .datepicker() on a div instead of an input.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\localization.html jQuery UI Datepicker - Localize calendar

Date:  

Localize the datepicker calendar language and format (English / Western formatting is the default). The datepicker includes built-in support for languages that read right-to-left, such as Arabic and Hebrew.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\min-max.html jQuery UI Datepicker - Restrict date range

Date:

Restrict the range of selectable dates with the minDate and maxDate options. Set the beginning and end dates as actual dates (new Date(2009, 1 - 1, 26)), as a numeric offset from today (-20), or as a string of periods and units ('+1M +10D'). For the last, use 'D' for days, 'W' for weeks, 'M' for months, or 'Y' for years.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\multiple-calendars.html jQuery UI Datepicker - Display multiple months

Date:

Set the numberOfMonths option to an integer of 2 or more to show multiple months in a single datepicker.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\other-months.html jQuery UI Datepicker - Dates in other months

Date:

The datepicker can show dates that come from other than the main month being displayed. These other dates can also be made selectable.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\datepicker\show-week.html jQuery UI Datepicker - Show week of the year

Date:

The datepicker can show the week of the year. The default calculation follows the ISO 8601 definition: the week starts on Monday, the first week of the year contains the first Thursday of the year. This means that some days from one year may be placed into weeks 'belonging' to another year.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\animated.html jQuery UI Dialog - Animation

This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.

Dialogs may be animated by specifying an effect for the show and/or hide properties. You must include the individual effects file for any effects you would like to use.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\default.html jQuery UI Dialog - Default functionality

This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.

Sed vel diam id libero rutrum convallis. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.


checkbox
radio



The basic dialog window is an overlay positioned within the viewport and is protected from page content (like select elements) shining through with an iframe. It has a title bar and a content area, and can be moved, resized and closed with the 'x' icon by default.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\index.html jQuery UI Dialog Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\modal-confirmation.html jQuery UI Dialog - Modal confirmation

These items will be permanently deleted and cannot be recovered. Are you sure?

Sed vel diam id libero rutrum convallis. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.


checkbox
radio



Confirm an action that may be destructive or important. Set the modal option to true, and specify primary and secondary user actions with the buttons option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\modal-form.html jQuery UI Dialog - Modal form

All form fields are required.

Existing Users:

Name Email Password
John Doe john.doe@example.com johndoe1

Use a modal dialog to require that the user enter data during a multi-step process. Embed form markup in the content area, set the modal option to true, and specify primary and secondary user actions with the buttons option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\modal-message.html jQuery UI Dialog - Modal message

Your files have downloaded successfully into the My Downloads folder.

Currently using 36% of your storage space.

Sed vel diam id libero rutrum convallis. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.


checkbox
radio



Use a modal dialog to explicitly acknowledge information or an action before continuing their work. Set the modal option to true, and specify a primary action (Ok) with the buttons option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\dialog\modal.html jQuery UI Dialog - Basic modal

Adding the modal overlay screen makes the dialog look more prominent because it dims out the page content.

Sed vel diam id libero rutrum convallis. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.


checkbox
radio



A modal dialog prevents the user from interacting with the rest of the page until it is closed.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\constrain-movement.html jQuery UI Draggable - Constrain movement

Constrain movement along an axis:

I can be dragged only vertically

I can be dragged only horizontally

Or to within another DOM element:

I'm contained within the box

I'm contained within the box's parent

I'm contained within my parent

Constrain the movement of each draggable by defining the boundaries of the draggable area. Set the axis option to limit the draggable's path to the x- or y-axis, or use the containment option to specify a parent DOM element or a jQuery selector, like 'document.'

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\cursor-style.html jQuery UI Draggable - Cursor style

I will always stick to the center (relative to the mouse)

My cursor is at left -5 and top -5

My cursor position is only controlled for the 'bottom' value

Position the cursor while dragging the object. By default the cursor appears in the center of the dragged object; use the cursorAt option to specify another location relative to the draggable (specify a pixel value from the top, right, bottom, and/or left). Customize the cursor's appearance by supplying the cursor option with a valid CSS cursor value: default, move, pointer, crosshair, etc.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\default.html jQuery UI Draggable - Default functionality

Drag me around

Enable draggable functionality on any DOM element. Move the draggable object by clicking on it with the mouse and dragging it anywhere within the viewport.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\delay-start.html jQuery UI Draggable - Delay start

Only if you drag me by 20 pixels, the dragging will start

Regardless of the distance, you have to drag and wait for 1000ms before dragging starts

Delay the start of dragging for a number of milliseconds with the delay option; prevent dragging until the cursor is held down and dragged a specifed number of pixels with the distance option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\events.html jQuery UI Draggable - Events

Drag me to trigger the chain of events.

Layer functionality onto the draggable using the start, drag, and stop events. Start is fired at the start of the drag; drag during the drag; and stop when dragging stops.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\handle.html jQuery UI Draggable - Handles

I can be dragged only by this handle

You can drag me around…

…but you can't drag me by this handle.

Allow dragging only when the cursor is over a specific part of the draggable. Use the handle option to specify the jQuery selector of an element (or group of elements) used to drag the object.

Or prevent dragging when the cursor is over a specific element (or group of elements) within the draggable. Use the cancel option to specify a jQuery selector over which to "cancel" draggable functionality.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\index.html jQuery UI Draggable Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\revert.html jQuery UI Draggable - Revert position

Revert the original

Revert the helper

Return the draggable (or it's helper) to its original location when dragging stops with the boolean revert option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\scroll.html jQuery UI Draggable - Auto-scroll

Scroll set to true, default settings

scrollSensitivity set to 100

scrollSpeed set to 100

Automatically scroll the document when the draggable is moved beyond the viewport. Set the scroll option to true to enable auto-scrolling, and fine-tune when scrolling is triggered and its speed with the scrollSensitivity and scrollSpeed options.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\snap-to.html jQuery UI Draggable - Snap to element or grid

I'm a snap target


Default (snap: true), snaps to all other draggable elements

I only snap to the big box

I only snap to the outer edges of the big box

I snap to a 20 x 20 grid

I snap to a 80 x 80 grid

Snap the draggable to the inner or outer boundaries of a DOM element. Use the snap, snapMode (inner, outer, both), and snapTolerance (distance in pixels the draggable must be from the element when snapping is invoked) options.

Or snap the draggable to a grid. Set the dimensions of grid cells (height and width in pixels) with the grid option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\sortable.html jQuery UI Draggable + Sortable

Draggables are built to interact seamlessly with sortables.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\draggable\visual-feedback.html jQuery UI Draggable - Visual feedback

With helpers:

Original

Semi-transparent clone

Custom helper (in combination with cursorAt)

Stacked:

We are draggables..

..whose z-indexes are controlled automatically..

..with the stack option.

Provide feedback to users as they drag an object in the form of a helper. The helper option accepts the values 'original' (the draggable object moves with the cursor), 'clone' (a duplicate of the draggable moves with the cursor), or a function that returns a DOM element (that element is shown near the cursor during drag). Control the helper's transparency with the opacity option.

To clarify which draggable is in play, bring the draggable in motion to front. Use the zIndex option to set a higher z-index for the helper, if in play, or use the stack option to ensure that the last item dragged will appear on top of others in the same group on drag stop.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\accepted-elements.html jQuery UI Droppable - Accept

I'm draggable but can't be dropped

Drag me to my target

accept: '#draggable'

Specify using the accept option which element (or group of elements) is accepted by the target droppable.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\default.html jQuery UI Droppable - Default functionality

Drag me to my target

Drop here

Enable any DOM element to be droppable, a target for draggable elements.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\index.html jQuery UI Droppable Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\photo-manager.html jQuery UI Droppable - Simple photo manager

Trash Trash

You can delete an image either by dragging it to the Trash or by clicking the trash icon.

You can "recycle" an image by dragging it back to the gallery or by clicking the recycle icon.

You can view larger image by clicking the zoom icon. jQuery UI dialog widget is used for the modal window.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\propagation.html jQuery UI Droppable - Prevent propagation

Drag me to my target

Outer droppable

Inner droppable (not greedy)

Outer droppable

Inner droppable (greedy)

When working with nested droppables — for example, you may have an editable directory structure displayed as a tree, with folder and document nodes — the greedy option set to true prevents event propagation when a draggable is dropped on a child node (droppable).

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\revert.html jQuery UI Droppable - Revert draggable position

I revert when I'm dropped

I revert when I'm not dropped

Drop me here

Return the draggable (or it's helper) to its original location when dragging stops with the boolean revert option set on the draggable.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\shopping-cart.html jQuery UI Droppable - Shopping Cart Demo

Products

T-Shirts

  • Lolcat Shirt
  • Cheezeburger Shirt
  • Buckit Shirt

Bags

  • Zebra Striped
  • Black Leather
  • Alligator Leather

Gadgets

  • iPhone
  • iPod
  • iPad

Shopping Cart

  1. Add your items here

Demonstrate how to use an accordion to structure products into a catalog and make use drag and drop for adding them to a shopping cart, where they are sortable.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\droppable\visual-feedback.html jQuery UI Droppable - Visual feedback

Feedback on hover:

Drag me to my target

Drop here

Feedback on activating draggable:

Drag me to my target

Drop here

Change the droppable's appearance on hover, or when the droppable is active (an acceptable draggable is dropped on it). Use the hoverClass or activeClass options to specify respective classes.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\effect\default.html jQuery UI Effects - Effect demo

Effect

Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.

Run Effect

Click the button above to show the effect.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\effect\easing.html jQuery UI Effects - Easing demo

All easings provided by jQuery UI are drawn above, using a HTML canvas element. Click a diagram to see the easing in action.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\effect\index.html jQuery UI Effects Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\hide\default.html jQuery UI Effects - Hide Demo

Hide

Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.

Run Effect

Click the button above to preview the effect.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\hide\index.html jQuery UI Effects Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\position\cycler.html jQuery UI Position - Default functionality

A prototype for the Photoviewer using Position to place images at the center, left and right and cycle them.
Use the links at the top to cycle, or click on the images on the left and right.
Note how the images are repositioned when resizing the window.
Warning: Doesn't currently work inside the demo viewer; open in a new window instead!

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\position\default.html jQuery UI Position - Default functionality

This is the position parent element.

to position

to position 2

position...
my:
at:
offset:
collision:

Use the form controls to configure the positioning, or drag the positioned element to modify its offset.
Drag around the parent element to see collision detection in action.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\position\index.html jQuery UI Position Demo

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\progressbar\animated.html jQuery UI Progressbar - Animated

This progressbar has an animated fill by setting the background-image on the .ui-progressbar-value element, using css.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\progressbar\default.html jQuery UI Progressbar - Default functionality

Default determinate progress bar.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\progressbar\index.html jQuery UI Progressbar Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\progressbar\resize.html jQuery UI Progressbar - Resizable

The progress bar's widths are specified in percentages for flexible sizing so it will resize to fit its container. Try resizing the height and width of this bar to see how it maintains the correct proportions. (This is not necessarily a real-world example, but it's a good illustration of how flexibly all the plugins are coded.)

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\removeClass\default.html jQuery UI Effects - removeClass Demo
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede.
Run Effect

Click the button above to preview the effect.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\removeClass\index.html jQuery UI Effects Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\animate.html jQuery UI Resizable - Animate

Animate

Animate the resize action using the animate option (boolean). When this option is set to true, drag the outline to the desired location; the element animates to that size on drag stop.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\aspect-ratio.html jQuery UI Resizable - Preserve aspect ratio

Preserve aspect ratio

Maintain the existing aspect ratio or set a new one to constrain the proportions on resize. Set the aspectRatio option to true, and optionally pass in a new ratio (i.e., 4/3)

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\constrain-area.html jQuery UI Resizable - Constrain resize area

Containment

Resizable

Define the boundaries of the resizable area. Use the containment option to specify a parent DOM element or a jQuery selector, like 'document.'

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\default.html jQuery UI Resizable - Default functionality

Resizable

Enable any DOM element to be resizable. With the cursor grab the right or bottom border and drag to the desired width or height.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\delay-start.html jQuery UI Resizable - Delay start

Time delay (ms):

Time

Distance delay (px):

Distance

Delay the start of resizng for a number of milliseconds with the delay option; prevent resizing until the cursor is held down and dragged a specifed number of pixels with the distance option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\helper.html jQuery UI Resizable - Helper

Helper

Display only an outline of the element while resizing by setting the helper option to a CSS class.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\index.html jQuery UI Resizable Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\max-min.html jQuery UI Resizable - Maximum / minimum size

Resize larger / smaller

Limit the resizable element to a maximum or minimum height or width using the maxHeight, maxWidth, minHeight, and minWidth options.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\snap-to-grid.html jQuery UI Resizable - Snap to grid

Grid

Snap the resizable element to a grid. Set the dimensions of grid cells (height and width in pixels) with the grid option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\synchronous-resize.html jQuery UI Resizable - Synchronous resize

Resize

will also resize

Resize multiple elements simultaneously by clicking and dragging the sides of one. Pass a shared selector into the alsoResize option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\textarea.html jQuery UI Resizable - Textarea

Display only an outline of the element while resizing by setting the helper option to a CSS class.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\resizable\visual-feedback.html jQuery UI Resizable - Visual feedback

Ghost

Instead of showing the actual element during resize, set the ghost option to true to show a semi-transparent part of the element.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\selectable\default.html jQuery UI Selectable - Default functionality
  1. Item 1
  2. Item 2
  3. Item 3
  4. Item 4
  5. Item 5
  6. Item 6
  7. Item 7

Enable a DOM element (or group of elements) to be selectable. Draw a box with your cursor to select items. Hold down the Ctrl key to make multiple non-adjacent selections.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\selectable\display-grid.html jQuery UI Selectable - Display as grid
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12

To arrange selectable items as a grid, give them identical dimensions and float them using CSS.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\selectable\index.html jQuery UI Selectable Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\selectable\serialize.html jQuery UI Selectable - Serialize

You've selected: none.

  1. Item 1
  2. Item 2
  3. Item 3
  4. Item 4
  5. Item 5
  6. Item 6

Write a function that fires on the stop event to collect the index values of selected items. Present values as feedback, or pass as a data string.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\show\default.html jQuery UI Effects - Show Demo

Show

Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.

Run Effect

Click the button above to preview the effect.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\show\index.html jQuery UI Effects Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\colorpicker.html jQuery UI Slider - Colorpicker

Simple Colorpicker

Combine three sliders to create a simple RGB colorpicker.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\default.html jQuery UI Slider - Default functionality

The basic slider is horizontal and has a single handle that can be moved with the mouse or by using the arrow keys.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\hotelrooms.html jQuery UI Slider - Range with fixed minimum

How to bind a slider to an existing select element. The select stays visible to display the change. When the select is changed, the slider is updated, too.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\index.html jQuery UI Slider Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\multiple-vertical.html jQuery UI Slider - Multiple sliders

Master volume

Graphic EQ

88 77 55 33 40 45 70

Combine horizontal and vertical sliders, each with their own options, to create the UI for a music player.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\range-vertical.html jQuery UI Slider - Vertical range slider

Change the orientation of the range slider to vertical. Assign a height value via .height() or by setting the height through CSS, and set the orientation option to "vertical."

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\range.html jQuery UI Slider - Range slider

Set the range option to true to capture a range of values with two drag handles. The space between the handles is filled with a different background color to indicate those values are selected.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\rangemax.html jQuery UI Slider - Range with fixed maximum

Fix the maximum value of the range slider so that the user can only select a minimum. Set the range option to "max."

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\rangemin.html jQuery UI Slider - Range with fixed minimum

Fix the minimum value of the range slider so that the user can only select a maximum. Set the range option to "min."

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\side-scroll.html jQuery UI Slider - Slider scrollbar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Use a slider to manipulate the positioning of content on the page. In this case, it acts as a scrollbar with the potential to capture values if needed.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\slider-vertical.html jQuery UI Slider - Vertical slider

Change the orientation of the slider to vertical. Assign a height value via .height() or by setting the height through CSS, and set the orientation option to "vertical."

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\steps.html jQuery UI Slider - Snap to increments

Increment slider values with the step option set to an integer, commonly a dividend of the slider's maximum value. The default increment is 1.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\slider\tabs.html jQuery UI Slider - Snap to increments

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

Control tabs with a slider.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\connect-lists-through-tabs.html jQuery UI Sortable - Connect lists with Tabs
  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5

Sort items from one list into another and vice versa, by dropping the list item on the appropriate tab above.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\connect-lists.html jQuery UI Sortable - Connect lists

Sort items from one list into another and vice versa, by passing a selector into the connectWith option. The simplest way to do this is to group all related lists with a CSS class, and then pass that class into the sortable function (i.e., connectWith: '.myclass').

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\default.html jQuery UI Sortable - Default functionality

Enable a group of DOM elements to be sortable. Click on and drag an element to a new spot within the list, and the other items will adjust to fit. By default, sortable items share draggable properties.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\delay-start.html jQuery UI Sortable - Delay start

Time delay of 300ms:

Distance delay of 15px:

Prevent accidental sorting either by delay (time) or distance. Set a number of milliseconds the element needs to be dragged before sorting starts with the delay option. Set a distance in pixels the element needs to be dragged before sorting starts with the distance option.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\display-grid.html jQuery UI Sortable - Display as grid

To arrange sortable items as a grid, give them identical dimensions and float them using CSS.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\empty-lists.html jQuery UI Sortable - Handle empty lists

Prevent all items in a list from being dropped into a separate, empty list using the dropOnEmpty option set to false. By default, sortable items can be dropped on empty lists.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\index.html jQuery UI Sortable Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\items.html jQuery UI Sortable - Include / exclude items

Specify which items are sortable:

Cancel sorting (but keep as drop targets):

Specify which items are eligible to sort by passing a jQuery selector into the items option. Items excluded from this option are not sortable, nor are they valid targets for sortable items.

To only prevent sorting on certain items, pass a jQuery selector into the cancel option. Cancelled items remain valid sort targets for others.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\placeholder.html jQuery UI Sortable - Drop placeholder

When dragging a sortable item to a new location, other items will make room for the that item by shifting to allow white space between them. Pass a class into the placeholder option to style that space to be visible. Use the boolean forcePlaceholderSize option to set dimensions on the placeholder.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\sortable\portlets.html jQuery UI Sortable - Portlets
Feeds
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
News
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Shopping
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Links
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Images
Lorem ipsum dolor sit amet, consectetuer adipiscing elit

Enable portlets (styled divs) as sortables and use the connectWith option to allow sorting between columns.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\switchClass\default.html jQuery UI Effects - switchClass Demo
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede.
Run Effect

Click the button above to preview the effect.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\switchClass\index.html jQuery UI Effects Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\ajax.html jQuery UI Tabs - Content via Ajax

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Fetch external content via Ajax for the tabs by setting an href value in the tab links. While the Ajax request is waiting for a response, the tab label changes to say "Loading...", then returns to the normal label once loaded.

Tabs 3 and 4 demonstrate slow-loading and broken AJAX tabs, and how to handle serverside errors in those cases. Note: These two require a webserver to interpret PHP. They won't work from the filesystem.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\bottom.html jQuery UI Tabs - Tabs at bottom

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

With some additional CSS (for positioning) and JS (to put the right classes on elements) the tabs can be placed below their content.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\collapsible.html jQuery UI Tabs - Collapse content

Click this tab again to close the content pane.

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Click this tab again to close the content pane.

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

Click this tab again to close the content pane.

Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

Click the selected tab to toggle its content closed/open. To enable this functionality, set the collapsible option to true.

collapsible: true
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\cookie.html jQuery UI Tabs - Default functionality

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

Looks the same as the default demo, but uses cookie to store the selected tab, and restore it when the page (re)loads. The cookie is stored for a day, so tabs will be restored even after closing the browser. Use cookie: {} for using cookies with default options.

The cookie option requires the cookie plugin, which can be found in the development-bundle > external folder from the download builder.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\default.html jQuery UI Tabs - Default functionality

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

Click tabs to swap between content that is broken into logical sections.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\index.html jQuery UI Tabs Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\manipulation.html jQuery UI Tabs - Simple manipulation

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Simple tabs adding and removing.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\mouseover.html jQuery UI Tabs - Open on mouseover

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

Toggle sections open/closed on mouseover with the event option. The default value for event is "click."

event: 'mouseover'
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\sortable.html jQuery UI Tabs - Sortable

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

Drag the tabs above to re-order them.

Making tabs sortable is as simple as calling .sortable() on the .ui-tabs-nav element.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\vertical.html jQuery UI Tabs - Vertical Tabs functionality

Content heading 1

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Content heading 2

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

Content heading 3

Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

Click tabs to swap between content that is broken into logical sections.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\ajax\content1.html

This content was loaded via ajax.

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Mauris vitae ante. Curabitur augue. Nulla purus nibh, lobortis ut, feugiat at, aliquam id, purus. Sed venenatis, lorem venenatis volutpat commodo, purus quam lacinia justo, mattis interdum pede pede a odio. Fusce nibh. Morbi nisl mauris, dapibus in, tristique eget, accumsan et, pede. Donec mauris risus, pulvinar ut, faucibus eu, mollis in, nunc. In augue massa, commodo a, cursus vehicula, varius eu, dui. Suspendisse sodales suscipit lorem. Morbi malesuada, eros quis condimentum dignissim, lectus nibh tristique urna, non bibendum diam massa vel risus. Morbi suscipit. Proin egestas, eros at scelerisque scelerisque, dolor lacus fringilla lacus, ut ullamcorper mi magna at quam. Aliquam sed elit. Aliquam turpis purus, congue quis, iaculis id, ullamcorper sit amet, justo. Maecenas sed mauris. Proin magna justo, interdum in, tincidunt eu, viverra eu, turpis. Suspendisse mollis. In magna. Phasellus pellentesque, urna pellentesque convallis pellentesque, augue sem blandit pede, at rhoncus libero nisl a odio.

Sed vitae nibh non magna semper tempor. Duis dolor. Nam congue laoreet arcu. Fusce lobortis enim quis ligula. Maecenas commodo odio id mi. Maecenas scelerisque tellus eu odio. Etiam dolor purus, lacinia a, imperdiet in, aliquam et, eros. In pellentesque. Nullam ac massa. Integer et turpis. Ut quam augue, congue non, imperdiet id, eleifend ac, nisi. Etiam ac arcu. Cras iaculis accumsan erat. Nullam vulputate sapien nec nisi pretium rhoncus. Aliquam a nibh. Vivamus est ante, fermentum a, tincidunt ut, imperdiet nec, velit. Aenean non tortor. Sed nec mauris eget tellus condimentum rutrum.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\tabs\ajax\content2.html

This other content was loaded via ajax.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean nec turpis justo, et facilisis ligula. In congue interdum odio, a scelerisque eros posuere ac. Aenean massa tellus, dictum sit amet laoreet ut, aliquam in orci. Duis eu aliquam ligula. Nullam vel placerat ligula. Fusce venenatis viverra dictum. Phasellus dui dolor, imperdiet in sodales at, mattis sed libero. Morbi ac ipsum ligula. Quisque suscipit dui vel diam pretium nec cursus lacus malesuada. Donec sollicitudin, eros eget dignissim mollis, risus leo feugiat tellus, vel posuere nisl ipsum eu erat. Quisque posuere lacinia imperdiet. Quisque nunc leo, elementum quis ultricies et, vehicula sit amet turpis. Nullam sed nunc nec nibh condimentum mattis. Quisque sed ligula sit amet nisi ultricies bibendum eget id nisi.

Proin ut erat vel nunc tincidunt commodo. Curabitur feugiat, nisi et vehicula viverra, nisl orci eleifend arcu, sed blandit lectus nisl quis nisi. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Aenean rutrum gravida velit ac imperdiet. Integer vitae arcu risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin tincidunt orci at leo egestas porta. Vivamus ac augue et enim bibendum hendrerit ut id urna. Donec sollicitudin pulvinar turpis vitae scelerisque. Etiam tempor porttitor est sed blandit. Phasellus varius consequat leo eget tincidunt. Aliquam ac dui lectus. In et consectetur orci. Duis posuere nulla ac turpis faucibus vestibulum. Sed ut velit et dolor rhoncus dapibus. Sed sit amet pellentesque est.

Nam in volutpat orci. Morbi sit amet orci in erat egestas dignissim. Etiam mi sapien, tempus sed iaculis a, adipiscing quis tellus. Suspendisse potenti. Nam malesuada tristique vestibulum. In tempor tellus dignissim neque consectetur eu vestibulum nisl pellentesque. Phasellus ultrices cursus velit, id aliquam nisl fringilla quis. Cras varius elit sed urna ultrices congue. Sed ornare odio sed velit pellentesque id varius nisl sodales. Sed auctor ligula egestas mi pharetra ut consectetur erat pharetra.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\toggle\default.html jQuery UI Effects - Toggle Demo

Toggle

Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.

Run Effect

Click the button above to preview the effect.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\toggle\index.html jQuery UI Effects Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\toggleClass\default.html jQuery UI Effects - toggleClass Demo
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede.
Run Effect

Click the button above to preview the effect.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\demos\toggleClass\index.html jQuery UI Effects Demos

Examples

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\accordion.html

jQuery UI Accordion

Overview

Make the selected elements Accordion widgets. Semantic requirements:

The markup of your accordion container needs pairs of headers and content panels:

<div id="accordion">
    <h3><a href="#">First header</a></h3>
    <div>First content</div>
    <h3><a href="#">Second header</a></h3>
    <div>Second content</div>
</div>

If you use a different element for the header, specify the header-option with an appropriate selector, eg. header: 'a.header'. The content element must be always next to its header.

If you have links inside the accordion content and use a-elements as headers, add a class to them and use that as the header, eg. header: 'a.header'.

Use activate(Number) to change the active content programmatically.

NOTE: If you want multiple sections open at once, don't use an accordion

An accordion doesn't allow more than one content panel to be open at the same time, and it takes a lot of effort to do that. If you are looking for a widget that allows more than one content panel to be open, don't use this. Usually it can be written with a few lines of jQuery instead, something like this:

jQuery(document).ready(function(){
	$('.accordion .head').click(function() {
		$(this).next().toggle();
		return false;
	}).next().hide();
});

Or animated:

jQuery(document).ready(function(){
	$('.accordion .head').click(function() {
		$(this).next().toggle('slow');
		return false;
	}).next().hide();
});

Dependencies

  • UI Core
  • UI Widget
  • UI Effects Core (Optional - only for non-default animations)

Example

A simple jQuery UI Accordion.

$("#accordion").accordion();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("#accordion").accordion();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="accordion">
	<h3><a href="#">Section 1</a></h3>
	<div>
		<p>
		Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
		ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
		amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
		odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
		</p>
	</div>
	<h3><a href="#">Section 2</a></h3>
	<div>
		<p>
		Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
		purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor
		velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In
		suscipit faucibus urna.
		</p>
	</div>
	<h3><a href="#">Section 3</a></h3>
	<div>
		<p>
		Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
		Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero
		ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis
		lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.
		</p>
		<ul>
			<li>List item one</li>
			<li>List item two</li>
			<li>List item three</li>
		</ul>
	</div>
	<h3><a href="#">Section 4</a></h3>
	<div>
		<p>
		Cras dictum. Pellentesque habitant morbi tristique senectus et netus
		et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in
		faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia
		mauris vel est.
		</p>
		<p>
		Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus.
		Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
		inceptos himenaeos.
		</p>
	</div>
</div>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Accordion plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.accordion.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<div class="ui-accordion ui-widget ui-helper-reset">
  <h3 class="ui-accordion-header ui-helper-reset ui-state-active ui-corner-top">
    <span class="ui-icon ui-icon-triangle-1-s"/>
    <a href="#">Section 1</a>
  </h3>
  <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
    Section 1 content
  </div>
  <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all">
    <span class="ui-icon ui-icon-triangle-1-e"/>
    <a href="#">Section 2</a>
  </h3>
  <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom">
    Section 2 content
  </div>
  <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all">
    <span class="ui-icon ui-icon-triangle-1-e"/>
    <a href="#">Section 3</a>
  </h3>
  <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom">
    Section 3 content
  </div>
</div>

Note: This is a sample of markup generated by the accordion plugin, not markup you should use to create a accordion. The only markup needed for that is
<div>
   <h3><a href="#">Section 1</a></h3>
   <div>
      Section 1 content
   </div>
   <h3><a href="#">Section 2</a></h3>
   <div>
      Section 2 content
   </div>
   <h3><a href="#">Section 3</a></h3>
   <div>
      Section 3 content
   </div>
</div>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\addClass.html

jQuery UI addClass

Overview

addClass( class, [duration] )

Adds the specified class to each of the set of matched elements with an optional transition between the states.

Dependencies

  • Effects Core

Example

Adds the class 'selected' to the matched elements with a one second transition.

$("p").click(function () {
      $(this).addClass("selected", 1000);
    });

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
<style type="text/css">
  p { cursor: pointer; font-size: 1.2em; }
  .selected { color:red; }
</style>
  <script>
  $(document).ready(function() {
    $("p").click(function () {
      $(this).addClass("selected", 1000);
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  <p>Click me to add a 'selected' class.</p>
<p>Click me to add a 'selected' class.</p>
<p>Click me to add a 'selected' class.</p>
</body>
</html>

Arguments

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\animate.html

The jQuery UI effects core extends the animate function to be able to animate colors as well. It's heavily used by the class transition feature and it's able to color animate the following properties:

with one of the following combinations:


NameType
Example:
A simple color animation.

$(".block").toggle(function() {
    $(this).animate({ backgroundColor: "black" }, 1000);
},function() {
    $(this).animate({ backgroundColor: "#68BFEF" }, 500);
});

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

  <script>
  $(document).ready(function(){
    $(".block").toggle(function() {
    $(this).animate({ backgroundColor: "black" }, 1000);
},function() {
    $(this).animate({ backgroundColor: "#68BFEF" }, 500);
});

  });
  </script>
  <style>
  .block { 
    color: white;
    background-color: #68BFEF;
    width: 150px; 
    height: 70px;
    margin: 10px; 
  }
  </style>
</head>
<body>
  <div class="block"> Click me</div>
</body>
</html>

NameType

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\autocomplete.html

jQuery UI Autocomplete

Overview

Autocomplete, when added to an input field, enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.

By giving an Autocomplete field focus or entering something into it, the plugin starts searching for entries that match and displays a list of values to choose from. By entering more characters, the user can filter down the list to better matches.

This can be used to enter previous selected values, for example you could use Autocomplete for entering tags, to complete an address, you could enter a city name and get the zip code, or maybe enter email addresses from an address book.

You can pull data in from a local and/or a remote source: Local is good for small data sets (like an address book with 50 entries), remote is necessary for big data sets, like a database with hundreds or millions of entries to select from.

Autocomplete can be customized to work with various data sources, by just specifying the source option. A data source can be:

  • an Array with local data
  • a String, specifying a URL
  • a Callback

Expected data format

The data from local data, a url or a callback can come in two variants:

  • An Array of Strings:
    [ "Choice1", "Choice2" ]
  • An Array of Objects with label and value properties:
    [ { label: "Choice1", value: "value1" }, ... ]

The label property is displayed in the suggestion menu. The value will be inserted into the input element after the user selected something from the menu. If just one property is specified, it will be used for both, eg. if you provide only value-properties, the value will also be used as the label.

When a String is used, the Autocomplete plugin expects that string to point to a URL resource that will return JSON data. It can be on the same host or on a different one (must provide JSONP). The Autocomplete plugin does not filter the results, instead the request parameter "term" gets added to the URL, which the server-side script should use for filtering the results. The data itself can be in the same format as the local data described above.

The third variation, the callback, provides the most flexibility, and can be used to connect any data source to Autocomplete. The callback gets two arguments:

  • A request object, with a single property called "term", which refers to the value currently in the text input. For example, when the user entered "new yo" in a city field, the Autocomplete term will equal "new yo".
  • A response callback, which expects a single argument to contain the data to suggest to the user. This data should be filtered based on the provided term, and can be in any of the formats described above for simple local data (String-Array or Object-Array with label/value/both properties). It's important when providing a custom source callback to handle errors during the request. You must always call the response callback even if you encounter an error. This ensures that the widget always has the correct state.

The label is always treated as text, if you want the label to be treated as html you can use Scott González' html extension. The demos all focus on different variations of the source-option - look for the one that matches your use case, and take a look at the code.

Dependencies

  • UI Core
  • UI Widget
  • UI Position

Example

A simple jQuery UI Autocomplete.

$("input#autocomplete").autocomplete({
    source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]
});

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("input#autocomplete").autocomplete({
    source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]
});
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<input id="autocomplete" />

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Autocomplete plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.autocomplete.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<input class="ui-autocomplete-input"/>
<ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all">
  <li class="ui-menu-item">
    <a class="ui-corner-all">item 1</a>
  </li>
  <li class="ui-menu-item">
    <a class="ui-corner-all">item 2</a>
  </li>
  <li class="ui-menu-item">
    <a class="ui-corner-all">item 3</a>
  </li>
</ul>

Note: This is a sample of markup generated by the autocomplete plugin, not markup you should use to create a autocomplete. The only markup needed for that is <input/>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\button.html

jQuery UI Button

Overview

Button enhances standard form elements like button, input of type submit or reset or anchors to themable buttons with appropiate mouseover and active styles.

In addition to basic push buttons, radio buttons and checkboxes (inputs of type radio and checkbox) can be converted to buttons: Their associated label is styled to appear as the button, while the underlying input is updated on click.

In order to group radio buttons, Button also provides an additional widget-method, called Buttonset. Its used by selecting a container element (which contains the radio buttons) and calling buttonset(). Buttonset will also provide visual grouping, and therefore should be used whenever you have a group of buttons. It works by selecting all descendents and applying button() to them. You can enable and disable a buttonset, which will enable and disable all contained buttons. Destroying a buttonset also calls the button's destroy method.

When using an input of type button, submit or reset, support is limited to plain text labels with no icons.

Dependencies

  • UI Core
  • UI Widget

Example

A simple jQuery UI Button.

$("button").button();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("button").button();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<button>Button label</button>

</body>
</html>

A simple jQuery UI Button.

$("#radio").buttonset();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("#radio").buttonset();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="radio">
	<input type="radio" id="radio1" name="radio" /><label for="radio1">Choice 1</label>
	<input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2">Choice 2</label>
	<input type="radio" id="radio3" name="radio" /><label for="radio3">Choice 3</label>
</div>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Button plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.button.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all">
   <span class="ui-button-text">Button Label</span>
</button>

Note: This is a sample of markup generated by the button plugin, not markup you should use to create a button. The only markup needed for that is <button>Button Label</button>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\datepicker.html

jQuery UI Datepicker

Overview

The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality to your pages. You can customize the date format and language, restrict the selectable date ranges and add in buttons and other navigation options easily.

By default, the datepicker calendar opens in a small overlay onFocus and closes automatically onBlur or when a date is selected. For an inline calendar, simply attach the datepicker to a div or span.

You can use keyboard shortcuts to drive the datepicker:

  • page up/down - previous/next month
  • ctrl+page up/down - previous/next year
  • ctrl+home - current month or open when closed
  • ctrl+left/right - previous/next day
  • ctrl+up/down - previous/next week
  • enter - accept the selected date
  • ctrl+end - close and erase the date
  • escape - close the datepicker without selection

Utility functions

Localization

Datepicker provides support for localizing its content to cater for different languages and date formats. Each localization is contained within its own file with the language code appended to the name, e.g. jquery.ui.datepicker-fr.js for French. The desired localization file should be included after the main datepicker code. They add their settings to the set of available localizations and automatically apply them as defaults for all instances.

The $.datepicker.regional attribute holds an array of localizations, indexed by language code, with "" referring to the default (English). Each entry is an object with the following attributes: closeText, prevText, nextText, currentText, monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, weekHeader, dateFormat, firstDay, isRTL, showMonthAfterYear, and yearSuffix.

You can restore the default localizations with:

$.datepicker.setDefaults($.datepicker.regional[""]);

And can then override an individual datepicker for a specific locale:

$(selector).datepicker($.datepicker.regional['fr']);

The localization files are included when using the jQuery UI download builder.

Dependencies

  • UI Core

Example

A simple jQuery UI Datepicker.

$("#datepicker").datepicker();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("#datepicker").datepicker();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="datepicker"></div>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Datepicker plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.datepicker.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible">
   <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">
      <a class="ui-datepicker-prev ui-corner-all" title="Prev"><span class="ui-icon ui-icon-circle-triangle-w">Prev</span></a>
      <a class="ui-datepicker-next ui-corner-all" title="Next"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a>
      <div class="ui-datepicker-title">
         <span class="ui-datepicker-month">January</span><span class="ui-datepicker-year">2009</span>
      </div>
   </div>
   <table class="ui-datepicker-calendar">
      <thead>
      <tr>
         <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
         ...
      </tr>
      </thead>
      <tbody><tr>
         <td class="ui-datepicker-week-end ui-datepicker-other-month "> 1 </td>
         ...
      </tr>
      </tbody>
   </table>
   <div class="ui-datepicker-buttonpane ui-widget-content">
      <button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all">Today</button>
      <button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all">Done</button>
   </div>
</div>

Note: This is a sample of markup generated by the datepicker plugin, not markup you should use to create a datepicker. The only markup needed for that is <input type="text" /> or <div></div>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\dialog.html

jQuery UI Dialog

Overview

A dialog is a floating window that contains a title bar and a content area. The dialog window can be moved, resized and closed with the 'x' icon by default.

If the content length exceeds the maximum height, a scrollbar will automatically appear.

A bottom button bar and semi-transparent modal overlay layer are common options that can be added.

A call to $(foo).dialog() will initialize a dialog instance and will auto-open the dialog by default. If you want to reuse a dialog, the easiest way is to disable the "auto-open" option with: $(foo).dialog({ autoOpen: false }) and open it with $(foo).dialog('open'). To close it, use $(foo).dialog('close'). A more in-depth explanation with a full demo is available on the Nemikor blog.

Dependencies

  • UI Core
  • UI Position
  • UI Widget
  • UI Mouse (Optional; only needed if using UI Draggable or UI Resizable)
  • UI Draggable (Optional)
  • UI Resizable (Optional)

Example

A simple jQuery UI Dialog.

$("#dialog").dialog();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("#dialog").dialog();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="dialog" title="Dialog Title">I'm in a dialog</div>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Dialog plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.dialog.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable">
   <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
      <span id="ui-dialog-title-dialog" class="ui-dialog-title">Dialog title</span>
      <a class="ui-dialog-titlebar-close ui-corner-all" href="#"><span class="ui-icon ui-icon-closethick">close</span></a>
   </div>
   <div style="height: 200px; min-height: 109px; width: auto;" class="ui-dialog-content ui-widget-content" id="dialog">
      <p>Dialog content goes here.</p>
   </div>
</div>

Note: This is a sample of markup generated by the dialog plugin, not markup you should use to create a dialog. The only markup needed for that is <div></div>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\draggable.html

jQuery UI Draggable

Overview

The jQuery UI Draggable plugin makes selected elements draggable by mouse.

Draggable elements gets a class of ui-draggable. During drag the element also gets a class of ui-draggable-dragging. If you want not just drag, but drag-and-drop, see the jQuery UI Droppable plugin, which provides a drop target for draggables.

All callbacks (start, stop, drag) receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'):

  • ui.helper - the jQuery object representing the helper that's being dragged
  • ui.position - current position of the helper as { top, left } object, relative to the offset element
  • ui.offset - current absolute position of the helper as { top, left } object, relative to page


To manipulate the position of a draggable during drag, you can either use a wrapper as the draggable helper and position the wrapped element with absolute positioning, or you can correct internal values like so: $(this).data('draggable').offset.click.top -= x.

Dependencies

  • UI Core
  • UI Widget
  • UI Mouse

Example

Initialize a draggable with default options.

$("#draggable").draggable();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <style type="text/css">
    #draggable { width: 100px; height: 70px; background: silver; }
  </style>
  <script>
  $(document).ready(function() {
    $("#draggable").draggable();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="draggable">Drag me</div>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Draggable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.draggable.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<div class="ui-draggable"></div>

Note: This is a sample of markup generated by the draggable plugin, not markup you should use to create a draggable. The only markup needed for that is <div></div>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\droppable.html

jQuery UI Droppable

Overview

The jQuery UI Droppable plugin makes selected elements droppable (meaning they accept being dropped on by draggables). You can specify which (individually) or which kind of draggables each will accept.

All callbacks receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'):

  • ui.draggable - current draggable element, a jQuery object.
  • ui.helper - current draggable helper, a jQuery object
  • ui.position - current position of the draggable helper { top: , left: }
  • ui.offset - current absolute position of the draggable helper { top: , left: }

Dependencies

Example

Makes the div droppable (a drop target for a draggable).

$("#draggable").draggable();
    $("#droppable").droppable({
      drop: function() { alert('dropped'); }
    });

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <style type="text/css">
    #draggable { width: 75px; height: 25px; background: silver; padding: 10px; }
    #droppable { position: absolute; left: 250px; top: 0; width: 125px; height: 75px; background: gray; color: white; padding: 10px; }
  </style>
  <script>
  $(document).ready(function() {
    $("#draggable").draggable();
    $("#droppable").droppable({
      drop: function() { alert('dropped'); }
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="droppable">Drop here</div>
<div id="draggable">Drag me</div>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Droppable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.droppable.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<div class="ui-droppable"></div>

Note: This is a sample of markup generated by the droppable plugin, not markup you should use to create a droppable. The only markup needed for that is <div></div>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\effect.html

jQuery UI effect

Overview

effect( effect, [options], [speed], [callback] )

Uses a specific effect on an element (without the show/hide logic).

Dependencies

  • Effects Core

Example

Apply the effect explode if you click on the element.

$("p").click(function () {
      $("div").effect("explode");
    });

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
<script src="http://ui.jquery.com/latest/ui/effects.explode.js"></script>
<style type="text/css">
  div { margin: 0 auto; width: 100px; height: 80px; background: blue; position: relative; }
</style>
  <script>
  $(document).ready(function() {
    $("p").click(function () {
      $("div").effect("explode");
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<p>Click me</p><div></div>

</body>
</html>

Arguments

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\hide.html

jQuery UI hide

Overview

hide( effect, [options], [speed], [callback] )

The enhanced hide method optionally accepts jQuery UI advanced effects.

Uses a specific effect on an element to hide the element if the first argument is an effect string.

Dependencies

  • Effects Core

Example

Apply the effect slide if you click on the p to hide a div.

$("p").click(function () {
      $("div").hide("slide", {}, 1000);
    });

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
<script src="http://ui.jquery.com/latest/ui/effects.slide.js"></script>
<style type="text/css">
  div { margin: 0px; width: 100px; height: 80px; background: blue; position: relative; }
</style>
  <script>
  $(document).ready(function() {
    $("p").click(function () {
      $("div").hide("slide", {}, 1000);
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<p>Click me</p><div></div>

</body>
</html>

Arguments

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\position.html

jQuery UI Position Utility

Overview

Utility script for positioning any widget relative to the window, document, a particular element, or the cursor/mouse.

Note: jQuery UI does not support positioning hidden elements.

Does not need ui.core.js or effects.core.js.

Dependencies

  • none (only jQuery core)

Example

Clicking on the green element transfers to the other.

$("#position1").position({
  my: "center",
  at: "center",
  of: "#targetElement"
});
$("#position2").position({
  my: "left top",
  at: "left top",
  of: "#targetElement"
});
$("#position3").position({
  my: "right center",
  at: "right bottom",
  of: "#targetElement"
});
$(document).mousemove(function(ev){
  $("#position4").position({
    my: "left bottom",
    of: ev,
    offset: "3 -3",
    collision: "fit"
  });
});

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <style type="text/css">
#targetElement { width:240px;height:200px;background-color:#999;margin:30px auto; }
.positionDiv { width:50px;height:50px;opacity:0.6; }
#position1 {background-color:#F00;}
#position2 {background-color:#0F0;}
#position3 {background-color:#00F;}
#position4 {background-color:#FF0;}
</style>

  <script>
  $(document).ready(function() {
    
$("#position1").position({
  my: "center",
  at: "center",
  of: "#targetElement"
});
$("#position2").position({
  my: "left top",
  at: "left top",
  of: "#targetElement"
});
$("#position3").position({
  my: "right center",
  at: "right bottom",
  of: "#targetElement"
});
$(document).mousemove(function(ev){
  $("#position4").position({
    my: "left bottom",
    of: ev,
    offset: "3 -3",
    collision: "fit"
  });
});

  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="targetElement">
  <div class="positionDiv" id="position1"></div>
  <div class="positionDiv" id="position2"></div>
  <div class="positionDiv" id="position3"></div>
  <div class="positionDiv" id="position4"></div>
</div>

</body>
</html>

Arguments

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\progressbar.html

jQuery UI Progressbar

Overview

The progress bar is designed to simply display the current % complete for a process. The bar is coded to be flexibly sized through CSS and will scale to fit inside it's parent container by default.

This is a determinate progress bar, meaning that it should only be used in situations where the system can accurately update the current status complete. A determinate progress bar should never fill from left to right, then loop back to empty for a single process -- if the actual percent complete status cannot be calculated, an indeterminate progress bar (coming soon) or spinner animation is a better way to provide user feedback.

Dependencies

  • UI Core
  • UI Widget

Example

A simple jQuery UI Progressbar.

$("#progressbar").progressbar({ value: 37 });

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("#progressbar").progressbar({ value: 37 });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="progressbar"></div>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Progressbar plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.progressbar.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<div class="ui-progressbar ui-widget ui-widget-content ui-corner-all">
   <div style="width: 37%;" class="ui-progressbar-value ui-widget-header ui-corner-left"></div>
</div>

Note: This is a sample of markup generated by the progressbar plugin, not markup you should use to create a progressbar. The only markup needed for that is <div></div>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\removeClass.html

jQuery UI removeClass

Overview

removeClass( [class], [duration] )

Removes all or specified class from each of the set of matched elements with an optional transition between the states.

Dependencies

  • Effects Core

Example

Removes the class 'selected' from the matched elements with a one second transition.

$("p").click(function () {
      $(this).removeClass("selected", 1000);
    });

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
<style type="text/css">
  p { cursor: pointer; font-size: 1.2em; }
  .selected { color:red; }
</style>
  <script>
  $(document).ready(function() {
    $("p").click(function () {
      $(this).removeClass("selected", 1000);
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<p class="selected">Click me to remove 'selected' class.</p>
<p class="selected">Click me to remove 'selected' class.</p>
<p class="selected">Click me to remove 'selected' class.</p>

</body>
</html>

Arguments

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\resizable.html

jQuery UI Resizable

Overview

The jQuery UI Resizable plugin makes selected elements resizable (meaning they have draggable resize handles). You can specify one or more handles as well as min and max width and height.

All callbacks (start,stop,resize) receive two arguments: The original browser event and a prepared ui object. The ui object has the following fields:

  • ui.helper - a jQuery object containing the helper element
  • ui.originalPosition - {top, left} before resizing started
  • ui.originalSize - {width, height} before resizing started
  • ui.position - {top, left} current position
  • ui.size - {width, height} current size

Dependencies

  • UI Core
  • UI Widget
  • UI Mouse

Example

A simple jQuery UI Resizable.

$("#resizable").resizable();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <style type="text/css">
    #resizable { width: 100px; height: 100px; background: silver; }
  </style>
  <script>
  $(document).ready(function() {
    $("#resizable").resizable();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="resizable"></div>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Resizable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.resizable.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<div class="ui-resizable">
   <div style="-moz-user-select: none;" unselectable="on" class="ui-resizable-handle ui-resizable-e"></div>
   <div style="-moz-user-select: none;" unselectable="on" class="ui-resizable-handle ui-resizable-s"></div>
   <div unselectable="on" style="z-index: 1001; -moz-user-select: none;" class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se"></div>
</div>

Note: This is a sample of markup generated by the resizable plugin, not markup you should use to create a resizable. The only markup needed for that is <div></div>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\selectable.html

jQuery UI Selectable

Overview

The jQuery UI Selectable plugin allows for elements to be selected by dragging a box (sometimes called a lasso) with the mouse over the elements. Also, elements can be selected by click or drag while holding the Ctrl/Meta key, allowing for multiple (non-contiguous) selections.

Dependencies

  • UI Core
  • UI Widget
  • UI Mouse

Example

A simple jQuery UI Selectable.

$("#selectable").selectable();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <style type="text/css">
#selectable .ui-selecting {
	background: silver;
}
#selectable .ui-selected {
	background: gray;
}
</style>

  <script>
  $(document).ready(function() {
    $("#selectable").selectable();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<ul id="selectable">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Selectable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.selectable.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<ul class="ui-selectable">
   <li class="ui-selectee"></li>
   <li class="ui-selectee"></li>
   <li class="ui-selectee"></li>
</ul>

Note: This is a sample of markup generated by the selectable plugin, not markup you should use to create a selectable. The only markup needed for that is
<ul>
   <li></li>
   <li></li>
   <li></li>
</ul>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\show.html

jQuery UI show

Overview

show( effect, [options], [speed], [callback] )

The enhanced show method optionally accepts jQuery UI advanced effects.

Uses a specific effect on an element to show the element if the first argument is a effect string.

Dependencies

  • Effects Core

Example

Apply the effect slide if you click on the p to show a div.

$("p").click(function () {
      $("div").show("slide", {}, 1000);
    });

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
<script src="http://ui.jquery.com/latest/ui/effects.slide.js"></script>
<style type="text/css">
  div { display: none; margin: 0px; width: 100px; height: 80px; background: blue; position: relative; }
</style>
  <script>
  $(document).ready(function() {
    $("p").click(function () {
      $("div").show("slide", {}, 1000);
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<p>Click me</p><div></div>

</body>
</html>

Arguments

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\slider.html

jQuery UI Slider

Overview

The jQuery UI Slider plugin makes selected elements into sliders. There are various options such as multiple handles, and ranges. The handle can be moved with the mouse or the arrow keys.

The start, slide, and stop callbacks receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'):

The slider widget will create handle elements with the class 'ui-slider-handle' on initialization. You can specify custom handle elements by creating and appending the elements and adding the 'ui-slider-handle' class before init. It will only create the number of handles needed to match the length of value/values. For example, if you specify 'values: [1, 5, 18]' and create one custom handle, the plugin will create the other two.

  • ui.handle: DOMElement - the current focused handle
  • ui.value: Integer - the current handle's value

Dependencies

  • UI Core
  • UI Widget
  • UI Mouse

Example

A simple jQuery UI Slider.

$("#slider").slider();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
    <style type="text/css">
    #slider { margin: 10px; }
  </style>
  <script>
  $(document).ready(function() {
    $("#slider").slider();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="slider"></div>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Slider plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.slider.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<div class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
   <a style="left: 0%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a>
</div>

Note: This is a sample of markup generated by the slider plugin, not markup you should use to create a slider. The only markup needed for that is <div><div>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\sortable.html

jQuery UI Sortable

Overview

The jQuery UI Sortable plugin makes selected elements sortable by dragging with the mouse.

All callbacks receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'):

  • ui.helper - the current helper element (most often a clone of the item)
  • ui.position - current position of the helper
  • ui.offset - current absolute position of the helper
  • ui.item - the current dragged element
  • ui.placeholder - the placeholder (if you defined one)
  • ui.sender - the sortable where the item comes from (only exists if you move from one connected list to another)

Dependencies

  • UI Core
  • UI Widget
  • UI Mouse

Example

A simple jQuery UI Sortable.

$("#sortable").sortable();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("#sortable").sortable();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<ul id="sortable">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>

</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Sortable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.sortable.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<ul class="ui-sortable">
   <li></li>
   <li class="ui-sortable-helper"></li>
   <li class="ui-sortable-placeholder"></li>
   <li></li>
</ul>

Note: This is a sample of markup generated by the sortable plugin, not markup you should use to create a sortable. The only markup needed for that is
<ul>
   <li></li>
   <li></li>
   <li></li>
</ul>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\switchClass.html

jQuery UI switchClass

Overview

switchClass( remove, add, [duration] )

Switches from the class defined in the first argument to the class defined as second argument, using an optional transition.

Dependencies

  • Effects Core

Example

Switch the class 'highlight' to 'blue' when a paragraph is clicked with a one second transition.

$("p").click(function () {
      $(this).switchClass("highlight", "blue", 1000);
    });

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
<style type="text/css">
  p { margin: 4px; font-size:16px; font-weight:bolder; 
      cursor:pointer; }
  .blue { background: blue; }
  .highlight { background:yellow; }
</style>
  <script>
  $(document).ready(function() {
    $("p").click(function () {
      $(this).switchClass("highlight", "blue", 1000);
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<p class="highlight">Click to switch</p>
<p class="highlight">to blue</p>
<p class="highlight">on these</p>
<p class="highlight">paragraphs</p>

</body>
</html>

Arguments

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\tabs.html

jQuery UI Tabs

Overview

Tabs are generally used to break content into multiple sections that can be swapped to save space, much like an accordion.

By default a tab widget will swap between tabbed sections onClick, but the events can be changed to onHover through an option. Tab content can be loaded via Ajax by setting an href on a tab.

NOTE: Tabs created dynamically using .tabs( "add", ... ) are given an id of ui-tabs-NUM, where NUM is an auto-incrementing id. If you use this naming convention for your own elements, you may encounter problems.

Contents

Events

A series of events fire when interacting with a tabs interface:

  • tabsselect, tabsload, tabsshow (in that order)
  • tabsadd, tabsremove
  • tabsenable, tabsdisable

Event binding example:

$('#example').bind('tabsselect', function(event, ui) {

    // Objects available in the function context:
    ui.tab     // anchor element of the selected (clicked) tab
    ui.panel   // element, that contains the selected/clicked tab contents
    ui.index   // zero-based index of the selected (clicked) tab

});

Note that if a handler for the tabsselect event returns false, the clicked tab will not become selected (useful for example if switching to the next tab requires a form validation).

Ajax mode

Tabs supports loading tab content via Ajax in an unobtrusive manner.

The HTML you need is slightly different from the one that is used for static tabs: A list of links pointing to existing resources (from where the content gets loaded) and no additional containers at all (unobtrusive!). The containers' markup is going to be created on the fly:

<div id="example">
     <ul>
         <li><a href="ahah_1.html"><span>Content 1</span></a></li>
         <li><a href="ahah_2.html"><span>Content 2</span></a></li>
         <li><a href="ahah_3.html"><span>Content 3</span></a></li>
     </ul>
</div>

Obviously this degrades gracefully - the links, e.g. the content, will still be accessible with JavaScript disabled.

Note that if you wish to reuse an existing container, you could do so by matching a title attribute and the container's id:

<li><a href="hello/world.html" title="Todo Overview"> ... </a></li>

and a container like:

<div id="Todo_Overview"> ... </div>

(Note how white space is replaced with an underscore)

This is useful if you want a human readable hash in the URL instead of a cryptic generated one.

Back button and bookmarking

Tabs 2 already supported this functionality, although the history plugin needs a rewrite first (it doesn't support Safari 3 and is in general a little inflexible) before it can be build back into the tabs. It is planned and Klaus is working on it whenever he finds the time. Actual bugs in the UI Tabs plugin itself always have higher priority though.

How to...

...retrieve the index of the currently selected tab

var $tabs = $('#example').tabs();
var selected = $tabs.tabs('option', 'selected'); // => 0

...open links in the current tab instead of leaving the page

"Hijax" links after tab content has been loaded:

$('#example').tabs({
    load: function(event, ui) {
        $(ui.panel).delegate('a', 'click', function(event) {
            $(ui.panel).load(this.href);
            event.preventDefault();
        });
    }
});

...select a tab from a text link instead of clicking a tab itself

var $tabs = $('#example').tabs(); // first tab selected

$('#my-text-link').click(function() { // bind click event to link
    $tabs.tabs('select', 2); // switch to third tab
    return false;
});

...prevent switching to the tab on click depending on form validation

Returning false in the tabs select handler prevents the clicked tab from becoming selected.

$('#example').tabs({
    select: function(event, ui) {
        var isValid = ... // form validation returning true or false
        return isValid;
    }
});

...immediately select a just added tab

var $tabs = $('#example').tabs({
    add: function(event, ui) {
        $tabs.tabs('select', '#' + ui.panel.id);
    }
});

...prevent a FOUC (Flash of Unstyled Content) before tabs are initialized

Add the necessary classes to hide an inactive tab panel to the HTML right away - note that this will not degrade gracefully with JavaScript being disabled:

<div id="example" class="ui-tabs">
  ...
  <div id="a-tab-panel" class="ui-tabs-hide"> </div>
  ...
</div>

Why does...

...my slider, Google Map, sIFR etc. not work when placed in a hidden (inactive) tab?

Any component that requires some dimensional computation for its initialization won't work in a hidden tab, because the tab panel itself is hidden via display: none so that any elements inside won't report their actual width and height (0 in most browsers).

There's an easy workaround. Use the off-left technique for hiding inactive tab panels. E.g. in your style sheet replace the rule for the class selector ".ui-tabs .ui-tabs-hide" with

.ui-tabs .ui-tabs-hide {
    position: absolute;
    left: -10000px;
}

For Google maps you can also resize the map once the tab is displayed like this:

$('#example').bind('tabsshow', function(event, ui) {
    if (ui.panel.id == "map-tab") {
        resizeMap();
    }
});
resizeMap() will call Google Maps' checkResize() on the particular map.

Dependencies

Example

A simple jQuery UI Tabs.

$("#tabs").tabs();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("#tabs").tabs();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="tabs">
    <ul>
        <li><a href="#fragment-1"><span>One</span></a></li>
        <li><a href="#fragment-2"><span>Two</span></a></li>
        <li><a href="#fragment-3"><span>Three</span></a></li>
    </ul>
    <div id="fragment-1">
        <p>First tab is active by default:</p>
        <pre><code>$('#example').tabs();</code></pre>
    </div>
    <div id="fragment-2">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    </div>
    <div id="fragment-3">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    </div>
</div>
</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Tabs plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.tabs.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<div class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
   <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
     <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#tabs-1">Nunc tincidunt</a></li>
      <li class="ui-state-default ui-corner-top"><a href="#tabs-2">Proin dolor</a></li>
   <div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="tabs-1">
      <p>Tab one content goes here.</p>
   </div>
    ...
</div>

Note: This is a sample of markup generated by the tabs plugin, not markup you should use to create a tabs. The only markup needed for that is
<div id="tabs">
   <ul>
      <li><a href="#tabs-1">Nunc tincidunt</a></li>
      <li><a href="#tabs-2">Proin dolor</a></li>
      <li><a href="#tabs-3">Aenean lacinia</a></li>
   </ul>
   <div id="tabs-1">
      <p>Tab 1 content</p>
   </div>
   <div id="tabs-2">
      <p>Tab 2 content</p>
   </div>
   <div id="tabs-3">
      <p>Tab 3 content</p>
   </div>
</div>.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\toggle.html

jQuery UI toggle

Overview

toggle( effect, [options], [speed], [callback] )

The enhanced toggle method optionally accepts jQuery UI advanced effects.

Uses a specific effect on an element to toggle the element if the first argument is an effect string.

Dependencies

  • Effects Core

Example

Apply the effect slide if you click on the p to toggle a div.

$("p").click(function () {
      $("div").toggle("slide", {}, 1000);
    });

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
<script src="http://ui.jquery.com/latest/ui/effects.slide.js"></script>
<style type="text/css">
  div { display: none; margin: 0px; width: 100px; height: 80px; background: blue; position: relative; }
</style>
  <script>
  $(document).ready(function() {
    $("p").click(function () {
      $("div").toggle("slide", {}, 1000);
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<p>Click me</p><div></div>

</body>
</html>

Arguments

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter17\development-bundle\docs\toggleClass.html

jQuery UI toggleClass

Overview

toggleClass( class, [duration] )

Adds the specified class if it is not present, and removes the specified class if it is present, using an optional transition.

Dependencies

  • Effects Core

Example

Adds the 'selected' class if it is not present, and removes the 'selected' class if it is present.

$("p").click(function () {
      $(this).toggleClass("selected", 1000);
    });

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
<style type="text/css">
  p { cursor: pointer; font-size: 1.2em; }
  .selected { color:red; }
</style>
  <script>
  $(document).ready(function() {
    $("p").click(function () {
      $(this).toggleClass("selected", 1000);
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<p>Click me to toggle 'selected' class.</p>
<p class="selected">Click me to toggle 'selected' class.</p>
<p>Click me to toggle 'selected' class.</p>

</body>
</html>

Arguments

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\footerbar.html Test Page for jQuery Mobile

Navbar Page

Content. Yay!

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\footerbarb.html Test Page for jQuery Mobile

Navbar Page

Content. Yay!

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\headerbutton.html Test Page for jQuery Mobile
Go Back

My Buttons

Go Forward

Content. Yay!

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\link.html Test Page for jQuery Mobile

Link Page

Load the test page

Footer content

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\links.html Test Page for jQuery Mobile

Link Page

Load the test page (default behavior)

Load the test page (data-ajax = false)

Load the test page (rel = external)

Load the test page (in new tab)

Braingia.org

Footer content

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\navbar.html Test Page for jQuery Mobile

Navbar Page

Content. Yay!

Footer content

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\pers-active.html Test Page for jQuery Mobile

Persistent Footer

I love creating content.

I love creating content.

I love creating content.

I love creating content.

I love creating content.

I love creating content.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\pers-full.html Test Page for jQuery Mobile

Persistent Footer

I love creating content.

I love creating content.

I love creating content.

I love creating content.

I love creating content.

I love creating content.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\pers.html Test Page for jQuery Mobile

Persistent Footer

I love creating content.

I love creating content.

I love creating content.

I love creating content.

I love creating content.

I love creating content.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\test-full.html Test Page for jQuery Mobile

Test Page

This is some nice content.

Footer content

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\test.html Test Page for jQuery Mobile ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\themee.html Test Page for jQuery Mobile

Test Page

This is some nice content.

Footer content

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\index.html jQuery Mobile: Demos and Documentation

jQuery Mobile Framework

A Touch-Optimized UI Framework built with jQuery and HTML5.

Welcome. jQuery Mobile is the easiest way to build sites and apps that are accessible on all popular smartphone, tablet and desktop devices. For jQuery 1.6.4 and 1.7.1.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\index.html jQuery Mobile: Demos and Documentation

jQuery Mobile Docs

Home

Nothing to see here folks.

View the documentation home page
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\nav.html jQuery UI Mobile Framework - Documentation ######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\accessibility.html jQuery Mobile Docs - Accessibility

Accessibility

Home Search

Accessibility

jQuery Mobile is built upon standard, semantic HTML, allowing pages to be accessible to the broadest range of devices possible. For A-Grade browsers, many of the components in jQuery Mobile leverage techniques such as focus management, keyboard navigation, and HTML attributes specified in the W3C's WAI-ARIA specification.

By utilizing these techniques, we do our best to ensure an accessible experience to users with disabilities such as blindness, who may use screen readers (like VoiceOver, on Apple's iPhone device) or other assistive technology to access the web.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\features.html jQuery Mobile Docs - Features

Features

Home Search

Key features:

  • Built on jQuery core for familiar and consistent jQuery syntax and minimal learning curve and leverages jQuery UI code and patterns.
  • Compatible with all major mobile, tablet, e-reader & desktop platforms - iOS, Android, Blackberry, Palm WebOS, Nokia/Symbian, Windows Phone 7, MeeGo, Opera Mobile/Mini, Firefox Mobile, Kindle, Nook and all modern browsers with graded levels of support.
  • Lightweight size and minimal image dependencies for speed.
  • Modular architecture for creating custom builds that are optimized to only include the features needed for a particular application.
  • HTML5 Markup-driven configuration of pages and behavior for fast development and minimal required scripting.
  • Progressive enhancement approach brings core content and functionality to all mobile, tablet and desktop platforms and a rich, installed application-like experience on newer mobile platforms.
  • Responsive design techniques and tools allow the same underlying codebase to automatically scale from smartphone to desktop-sized screens.
  • Powerful Ajax-powered navigation system to enable animated page transitions while maintaining back button, bookmarking and clean URLs through pushState.
  • Accessibility features such as WAI-ARIA are also included to ensure that the pages work for screen readers (e.g. VoiceOver in iOS) and other assistive technologies.
  • Touch and mouse event support streamline the process of supporting touch, mouse and cursor focus-based user input methods with a simple API.
  • Unified UI widgets for common controls enhance native controls with touch-optimized, themable controls that are platform-agnostic and easy to use.
  • Powerful theming framework and the ThemeRoller application make highly-branded experiences easy to build.
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\getting-started.html jQuery Mobile Docs - Quick start

Quick start guide

Home Search

Getting Started with jQuery Mobile

jQuery Mobile provides a set of touch-friendly UI widgets and an AJAX-powered navigation system to support animated page transitions. Building your first jQuery Mobile page is easy, here's how:

Create a basic page template

Pop open your favorite text editor, paste in the page template below, save and open in a browser. You are now a mobile developer!

Here's what's in the template. In the head, a meta viewport tag sets the screen width to the pixel width of the device and references to jQuery, jQuery Mobile and the mobile theme stylesheet from the CDN add all the styles and scripts. jQuery Mobile 1.1 works with both 1.6.4 and 1.7.1 versions of jQuery core.

In the body, a div with a data-role of page is the wrapper used to delineate a page, and the header bar (data-role="header") and content region (data-role="content") are added inside to create a basic page (these are both optional). These data- attributes are HTML5 attributes are used throughout jQuery Mobile to transform basic markup into an enhanced and styled widget.


<!DOCTYPE html> 
<html> 
	<head> 
	<title>My Page</title> 
	<meta name="viewport" content="width=device-width, initial-scale=1"> 
	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
	<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
</head> 
<body> 

<div data-role="page">

	<div data-role="header">
		<h1>My Title</h1>
	</div><!-- /header -->

	<div data-role="content">	
		<p>Hello world</p>		
	</div><!-- /content -->

</div><!-- /page -->

</body>
</html>

Add your content

Inside your content container, you can add any standard HTML elements - headings, lists, paragraphs, etc. You can write your own custom styles to create custom layouts by adding an additional stylesheet to the head after the jQuery Mobile stylesheet.

Make a listview

jQuery Mobile includes a diverse set of common listviews that are coded as lists with a data-role="listview" added. Here is a simple linked list that has a role of listview. We're going to make this look like an inset module by adding a data-inset="true" and add a dynamic search filter with the data-filter="true" attributes.


<ul data-role="listview" data-inset="true" data-filter="true">
	<li><a href="#">Acura</a></li>
	<li><a href="#">Audi</a></li>
	<li><a href="#">BMW</a></li>
	<li><a href="#">Cadillac</a></li>
	<li><a href="#">Ferrari</a></li>
</ul>

Add a slider

The framework contains a full set of form elements that automatically are enhanced into touch-friendly styled widgets. Here's a slider made with the new HTML5 input type of range, no data-role needed. Be sure to wrap these in a form element and always properly associate a label to every form element.


<form>
   <label for="slider-0">Input slider:</label>
   <input type="range" name="slider" id="slider-0" value="25" min="0" max="100"  />
</form>

Make a button

There are a few ways to make buttons, but lets turn a link into a button so it's easy to click. Just start with a link and add a data-role="button" attribute to it. You can add an icon with the data-icon attribute and optionally set its position with the data-iconpos attribute.


<a href="#" data-role="button" data-icon="star">Star button</a>
Star button

Play with theme swatches

jQuery Mobile has a robust theme framework that supports up to 26 sets of toolbar, content and button colors, called a "swatch". Just add a data-theme="e" attribute to any of the widgets on this page: page, header, list, input for the slider, or button to turn it yellow. Try different swatch letters in default theme from a-e to mix and match swatches.

Cool party trick: add the theme swatch to the page and see how all the widgets inside the content will automatically inherit the theme (headers and footers don't inherit, they default to swatch "a").

<a href="#" data-role="button" data-icon="star" data-theme="a">Button</a> data-theme="a" data-theme="b" data-theme="c" data-theme="d" data-theme="e"

When you're ready to build a custom theme, use ThemeRoller to drag and drop, then download a custom theme.

Go forth and build stuff

This is just scratching the surface of all the cool things you can build with jQuery Mobile with little effort. Be sure to explore linking pages, adding animated page transitions, and creating dialogs. Use the data-attribute reference to try out some of the other data- attributes you can play with.

More of a developer? Great, forget everything we just covered (kidding). If you don't want to use the data- attribute configuration system, you can take full control of everything and call plugins directly because these are all just standard jQuery plugins built with the UI widget factory. Be sure to dig into global configuration, events, and methods. Then read up on scripting pages, generating dynamic pages, and building PhoneGap apps.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\index.html jQuery UI Mobile Framework - About

About jQuery Mobile

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\intro.html jQuery Mobile Docs - Intro

Introduction

Home Search

jQuery Mobile Overview

jQuery’s mobile strategy can be summarized simply: A unified user interface system that works seamlessly across all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Focused on a feature-rich but lightweight codebase built on progressive enhancement with a flexible, theming system and ThemeRoller tool.

The framework includes an Ajax navigation system that brings animated page transitions and a core set of UI widgets: pages, dialogs, toolbars, listviews, buttons with icons, form elements, accordions, collapsibles, and more.

The critical difference with our approach is the wide variety of mobile platforms we’re targeting with jQuery Mobile so no browser or device is left behind. We've also focused on making jQuery Mobile easy to learn with a simple, markup-based system to applying behavior and theming. For more advanced developers, there is a rich API of global configuration options, events, and methods to apply scripting, generate dynamic pages, and even build native apps with tools like PhoneGap.

To make this broad support possible, all pages in jQuery Mobile are built on a foundation of clean, semantic HTML to ensure compatibility with pretty much any web-enabled device. In devices that interpret CSS and JavaScript, jQuery Mobile applies progressive enhancement techniques to unobtrusively transform the semantic page into a rich, interactive experience that leverages the power of jQuery and CSS. Accessibility features such as WAI-ARIA are tightly integrated throughout the framework to provide support for screen readers and other assistive technologies.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\about\platforms.html jQuery Mobile Docs - Supported platforms

Supported platforms

Home Search

jQuery Mobile Supported Platforms

jQuery Mobile has broad support for the vast majority of all modern desktop, smartphone, tablet, and e-reader platforms. In addition, feature phones and older browsers are supported because of our progressive enhancement approach. We're very proud of our commitment to universal accessibility through our broad support for all popular platforms.

We use a 3-level graded platform support system: A (full), B (full minus Ajax), C (basic HTML). The visual fidelity of the experience and smoothness of page transitions are highly dependent on the CSS rendering capabilities of the device and platform so not all A grade experience will be pixel-perfect but that's the nature of the web.

A-grade - Full enhanced experience with Ajax-based animated page transitions.

  • Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.0)
  • Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5)
  • Android 3.1 (Honeycomb)  - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM
  • Android 4.0 (ICS)  - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices
  • Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800
  • Blackberry 6.0 - Tested on the Torch 9800 and Style 9670
  • Blackberry 7 - Tested on BlackBerry® Torch 9810
  • Blackberry Playbook (1.0-2.0) - Tested on PlayBook
  • Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0)
  • Palm WebOS 3.0 - Tested on HP TouchPad
  • Firefox Mobile (10 Beta) - Tested on Android 2.3 device
  • Chrome for Android (Beta) - Tested on Android 4.0 device
  • Skyfire 4.1 - Tested on Android 2.3 device
  • Opera Mobile 11.5-12: Tested on Android 2.3
  • Meego 1.2 - Tested on Nokia 950 and N9
  • Samsung bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser
  • UC Browser - Tested on Android 2.3 device
  • Kindle 3 and Fire - Tested on the built-in WebKit browser for each
  • Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet
  • Chrome Desktop 11-19 - Tested on OS X 10.7 and Windows 7
  • Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7
  • Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7
  • Internet Explorer 7-9 - Tested on Windows XP, Vista and 7
  • Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7

B-grade - Enhanced experience except without Ajax navigation features.

  • Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770
  • Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3
  • Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1)

C-grade - Basic, non-enhanced HTML experience that is still functional

  • Blackberry 4.x - Tested on the Curve 8330
  • Windows Mobile - Tested on the HTC Leo (WinMo 5.2)
  • All older smartphone platforms and featurephones - Any device that doesn't support media queries will receive the basic, C grade experience
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\data-attributes.html jQuery Mobile Docs - Data Attribute Reference

Data Attributes

Home Search

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 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-content-theme swatch letter (a-z)
data-iconpos left | right | top | bottom
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-content-theme swatch letter (a-z) - Sets all collapsibles in set
data-iconpos left | right | top | bottom | notext
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 elements inside data-enhance="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/bottom padding updated on other events than when page is shown as well (resize, transition, "updatelayout")
data-visible-on-page-show true | false - Toolbar-visibility when parent page is shown

Flip toggle switch

Select with data-role="slider", two options only

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, useful in persistent footers)
data-position fixed
data-fullscreen true (used in conjunction with fixed toolbars)
data-theme swatch letter (a-z)

Header

Container with data-role="header"

data-id string (unique id, useful in persistent headers)
data-position fixed
data-fullscreen true (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 page transition animation)
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)
data-transition fade | flip | flow | pop | slide | slidedown | slidefade | slideup | turn | none

Listview

OL or UL with data-role="listview"

data-count-theme swatch letter (a-z) (default "c" if unset)
data-divider-theme swatch letter (a-z) (default "b" if unset)
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" if unset)
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) - can also be set on individual LIs

The data-icon attribute is only applicable for a listview item, if it contains a link.

Navbar

A number of LIs 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 (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)
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)

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
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 - Add to the Option
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
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\events-nav.html jQuery Mobile Docs - Events

Events

Home Search

Framework, Page, and Navigation Events

jQuery Mobile's widget and navigation system has a full set of events at each stage of the page load and page change process that can be tapped into to take full control. This page will highlight the most commonly used events and what they do, and also provide chronologies of when these events are triggered during load and transitions.

Framework events

When jQuery Mobile initializes, it triggers an event on the document that is specifically designed for overriding framework and plugin defaults. That event is called mobileinit, and by binding to it, you can ensure that any global or plugin configuration options are overridden to any value you'd like before they are used by the framework's initial execution.

				
$(document).bind("mobileinit", function(){
  //apply overrides here
});
				
			

The tricky aspect of mobileinit is that you need to bind to it before jQuery Mobile executes, so a typical mobileinit workflow would occur in a script that is referenced after jQuery itself, but before jQuery Mobile.

It should be noted that while you can bind to other events from within a mobileinit callback, it is likely that you'll get undesirable results in doing so. This is because many events, such as the page events below, are intended for external developers to use after jQuery Mobile's plugins have loaded.

Page creation events

In a jQuery Mobile application, each view is known as a page. Pages generally begin as a regular HTML element with a data-role="page" attribute, and the framework's page widget enhances that element into a jQuery Mobile page control. In the process of enhancing that page, the widget dispatches several events that allow you to access that page and its child elements at different stages of creation.

These events are:

pagecreate
This event is triggered on a page when it is first initialized by the page plugin. pagecreate is the most useful event for progressively enhancing a page's markup when it first loads, and because of this, many of jQuery Mobile's standard widgets bind to pagecreate to enhance markup within pages as well! If you bind to pagecreate in any script that is referenced after the jQuery Mobile framework, any native jQuery Mobile widgets in that page will be enhanced before your event callback executes. In other words, you'll be dealing with enhanced jQuery Mobile components.
pagebeforecreate
This event is triggered on a page element just before it is created by the page plugin. While the pagecreate event generally allows you to work with a page after its markup has been enhanced by jQuery Mobile, pagebeforecreate gives you access when the markup has not yet been enhanced. pagebeforecreate is useful for modifying markup before jQuery Mobile's widgets
pageinit
pageinit is very similar to pagecreate, except that none of jQuery Mobile's standard widgets bind to it, and it is guaranteed to execute after all bound pagecreate callbacks have finished. If you need to bind to a page creation-time event via a script that is referenced before jQuery Mobile, binding to pageinit will ensure that you deal with enhanced page controls (whereas pagecreate will not, in that specific case.)

Page navigation events

After pages are created, they are often shown and hidden one or many times throughout the use of a jQuery Mobile app. For A-grade browsers with Ajax navigation support, the jQM navigation model manages these page behaviors and dispatches useful events at different steps in the process of showing, hiding, and changing.

Page showing events

The page showing events (pagebeforeshow and pageshow) are guaranteed to fire every time a page is shown, whether you're opening a single page, or transitioning between two pages. The target of the event is the page that is being shown.

pagebeforeshow
An event triggered on a page before it is shown.
pageshow
An event triggered on the page after it is shown.

Page hiding events

The page hiding events (pagebeforehide and pagehide) only fire when transitioning between two pages, when an outgoing page is being hidden in favor of a new one. The target of the event is the page that is being shown.

pagebeforehide
An event triggered on a page before it is hidden.
pagehide
An event triggered on a page after it is hidden.

When a single page is being shown, and no page is hidden, only the pagebeforeshow and pageshow events will fire, and in that order.

During a transition between two pages, all 4 of the events above will fire, in this order:

Chronology

Here is an overview of the event chronology for a page change

You can bind to these events like you would with other jQuery events, using live() or bind().

Important: Use pageInit(), not $(document).ready()

The first thing you learn in jQuery is to call code inside the $(document).ready() function so everything will execute as soon as the DOM is loaded. However, in jQuery Mobile, Ajax is used to load the contents of each page into the DOM as you navigate, and the DOM ready handler only executes for the first page. To execute code whenever a new page is loaded and created, you can bind to the pageinit event. This event is explained in detail at the bottom of this page.

 

Important: pageCreate() vs pageInit()

Prior to Beta 2 the recommendation to users wishing to manipulate jQuery Mobile enhanced page and child widget markup was to bind to the pagecreate event. In Beta 2 an internal change was made to decouple each of the widgets by binding to the pagecreate event in place of direct calls to the widget methods. As a result, users binding to the pagecreate from within mobileinit would find their binding executing before the markup had been enhanced by each of the plugins. In keeping with the lifecycle of the jQuery UI Widget Factory, the initialization method is invoked after the create method, so the pageinit event provides the correct timing for post enhancement manipulation of the DOM and/or Javascript objects.

Page load events

Whenever an external page is loaded into the application DOM, 2 events are fired. The first is pagebeforeload. The 2nd event will be either pageload or pageloadfailed.

pagebeforeload

Triggered before any load request is made. Callbacks bound to this event can call preventDefault() on the event to indicate that they are handling the load request. Callbacks that do this *MUST* make sure they call resolve() or reject() on the deferred object reference contained in the data object passed to the callback.

The data object, passed as the 2nd arg to the callback function contains the following properties:

  • url (string)
    • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
  • absUrl (string)
    • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
  • dataUrl (string)
    • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
  • deferred (object)
    • Callbacks that call preventDefault() on the event, *MUST* call resolve() or reject() on this object so that changePage() requests resume processing. Deferred object observers expect the deferred object to be resolved like this:

      
      $( document ).bind( "pagebeforeload", function( event, data ){
      
      	// Let the framework know we're going to handle the load.
      
      	event.preventDefault();
      
      	// ... load the document then insert it into the DOM ...
      	// at some point, either in this callback, or through
      	// some other async means, call resolve, passing in
      	// the following args, plus a jQuery collection object
      	// containing the DOM element for the page.
      
      	data.deferred.resolve( data.absUrl, data.options, page );
      
      });

      or rejected like this:

      
      $( document ).bind( "pagebeforeload", function( event, data ){
      
      	// Let the framework know we're going to handle the load.
      
      	event.preventDefault();
      
      	// ... load the document then insert it into the DOM ...
      	// at some point, if the load fails, either in this
      	// callback, or through some other async means, call
      	// reject like this:
      
      	data.deferred.reject( data.absUrl, data.options );
      
      });
  • options (object)
    • This object contains the options that were passed into $.mobile.loadPage().
pageload
Triggered after the page is successfully loaded and inserted into the DOM. Callbacks bound to this event will be passed a data object as its 2nd arg. This object contains the following information:
  • url (string)
    • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
  • absUrl (string)
    • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
  • dataUrl (string)
    • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
  • options (object)
    • This object contains the options that were passed into $.mobile.loadPage().
  • xhr (object)
    • The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the 3rd argument to the framework's $.ajax() success callback.
  • textStatus (null or string)
    • According to the jQuery Core documentation, this will be a string describing the status. This is what gets passed as the 2nd argument to the framework's $.ajax() error callback.
pageloadfailed
Triggered if the page load request failed. By default, after dispatching this event, the framework will display a page failed message and call reject() on the deferred object contained within the event's data object. Callbacks can prevent this default behavior from executing by calling preventDefault() on the event.

The data object, passed as the 2nd arg to the callback function contains the following properties:

  • url (string)
    • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
  • absUrl (string)
    • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
  • dataUrl (string)
    • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
  • deferred (object)
    • Callbacks that call preventDefault() on the event, *MUST* call resolve() or reject() on this object so that changePage() requests resume processing. Deferred object observers expect the deferred object to be resolved like this:

      
      $( document ).bind( "pageloadfailed", function( event, data ){
      
      	// Let the framework know we're going to handle things.
      
      	event.preventDefault();
      
      	// ... attempt to load some other page ...
      	// at some point, either in this callback, or through
      	// some other async means, call resolve, passing in
      	// the following args, plus a jQuery collection object
      	// containing the DOM element for the page.
      
      	data.deferred.resolve( data.absUrl, data.options, page );
      
      });

      or rejected like this:

      
      $( document ).bind( "pageloadfailed", function( event, data ){
      
      	// Let the framework know we're going to handle things.
      
      	event.preventDefault();
      
      	// ... attempt to load some other page ...
      	// at some point, if the load fails, either in this
      	// callback, or through some other async means, call
      	// reject like this:
      
      	data.deferred.reject( data.absUrl, data.options );
      
      });
  • options (object)
    • This object contains the options that were passed into $.mobile.loadPage().
  • xhr (object)
    • The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the first argument to the framework's $.ajax() error callback.
  • textStatus (null or string)
    • According to the jQuery Core documentation, possible values for this property, aside from null, are "timeout", "error", "abort", and "parsererror". This is what gets passed as the 2nd argument to the framework's $.ajax() error callback.
  • errorThrown (null, string, object)
    • According to the jQuery Core documentation, this property may be an exception object if one occured, or if an HTTP error occured this will be set to the textual portion of the HTTP status. This is what gets passed as the 3rd argument to the framework's $.ajax() error callback.

Page change events

Navigating between pages in the application is usually accomplished through a call to $.mobile.changePage(). This function is responsible for making sure that the page we are navigating to is loaded and inserted into the DOM, and then kicking off the transition animations between the current active page, and the page the caller wants to to make active. During this process, which is usually asynchronous, changePage() will fire off 2 events. The first is pagebeforechange. The second event depends on the success or failure of the change request. It will either be pagechange or pagechangefailed.

pagebeforechange
This event is triggered prior to any page loading or transition. Callbacks can prevent execution of the changePage() function by calling preventDefault on the event object passed into the callback. The callback also receives a data object as its 2nd arg. The data object has the following properties:
  • toPage (object or string)
    • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
  • options (object)
    • This object contains the configuration options to be used for the current changePage() call.

It should be noted that callbacks can modify both the toPage and options properties to alter the behavior of the current changePage() call. So for example, the toPage can be mapped to a different url from within a callback to do a sort of redirect.

pagechange
This event is triggered after the changePage() request has finished loading the page into the DOM and all page transition animations have completed. Note that any pageshow or pagehide events will have fired *BEFORE* this event is triggered. Callbacks for this particular event will be passed a data object as the 2nd arg. The properties for this object are as follows:
  • toPage (object or string)
    • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
  • options (object)
    • This object contains the configuration options to be used for the current changePage() call.
pagechangefailed
This event is triggered when the changePage() request fails to load the page. Callbacks for this particular event will be passed a data object as the 2nd arg. The properties for this object are as follows:
  • toPage (object or string)
    • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
  • options (object)
    • This object contains the configuration options to be used for the current changePage() call.

Page transition events

Page transitions are used to animate the change from the current active page (fromPage) to a new page (toPage). Events are triggered before and after these transitions so that observers can be notified whenever pages are shown or hidden. The events triggered are as follows:

pagebeforeshow
Triggered on the "toPage" we are transitioning to, before the actual transition animation is kicked off. Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it:
  • prevPage (object)
    • A jQuery collection object that contains the page DOM element that we are transitioning away from. Note that this collection is empty when the first page is transitioned in during application startup.
pagebeforehide
Triggered on the "fromPage" we are transitioning away from, before the actual transition animation is kicked off. Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it:
  • nextPage (object)
    • A jQuery collection object that contains the page DOM element that we are transitioning to.

Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.

pageshow
Triggered on the "toPage" after the transition animation has completed. Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it:
  • prevPage (object)
    • A jQuery collection object that contains the page DOM element that we just transitioned away from. Note that this collection is empty when the first page is transitioned in during application startup.
pagehide
Triggered on the "fromPage" after the transition animation has completed. Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it:
  • nextPage (object)
    • A jQuery collection object that contains the page DOM element that we just transitioned to.

Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.

You can access the prevPage or nextPage properties via the second argument of a bound callback function. For example:


$( 'div' ).live( 'pageshow',function(event, ui){
  alert( 'This page was just hidden: '+ ui.prevPage);
});

$( 'div' ).live( 'pagehide',function(event, ui){
  alert( 'This page was just shown: '+ ui.nextPage);
});

Also, for these handlers to be invoked during the initial page load, you must bind them before jQuery Mobile executes. This can be done in the mobileinit handler, as described on the global config page.

Page initialization events

Internally, jQuery Mobile auto-initializes plugins based on the markup conventions found in a given "page". For example, an input element with a type of range will automatically generate a custom slider control.

This auto-initialization is controlled by the "page" plugin, which dispatches events before and after it executes, allowing you to manipulate a page either pre-or-post initialization, or even provide your own intialization behavior and prevent the auto-initializations from occuring. Note that these events will only fire once per "page", as opposed to the show/hide events, which fire every time a page is shown and hidden.

pagebeforecreate

Triggered on the page being initialized, before most plugin auto-initialization occurs.


$( '#aboutPage' ).live( 'pagebeforecreate',function(event){
  alert( 'This page was just inserted into the dom!' );
});

Note that by binding to pagebeforecreate, you can manipulate markup before jQuery Mobile's default widgets are auto-initialized. For example, say you want to add data-attributes via JavaScript instead of in the HTML source, this is the event you'd use.


$( '#aboutPage' ).live( 'pagebeforecreate',function(event){
  // manipulate this page before its widgets are auto-initialized
});
pagecreate

Triggered when the page has been created in the DOM (via ajax or other) but before all widgets have had an opportunity to enhance the contained markup. This event is most useful for user's wishing to create their own custom widgets for child markup enhancement as the jquery mobile widgets do.


$( '#aboutPage' ).live( 'pagecreate',function(event){
  ( ":jqmData(role='sweet-plugin')" ).sweetPlugin();
});
pageinit

Triggered on the page being initialized, after initialization occurs. We recommend binding to this event instead of DOM ready() because this will work regardless of whether the page is loaded directly or if the content is pulled into another page as part of the Ajax navigation system.


$( '#aboutPage' ).live( 'pageinit',function(event){
  alert( 'This page was just enhanced by jQuery Mobile!' );
});

Page remove events

By default, the framework removes any non active dynamically loaded external pages from the DOM as soon as the user navigates away to a different page. The pageremove event is dispatched just before the framework attempts to remove the a page from the DOM.

pageremove
This event is triggered just before the framework attempts to remove an external page from the DOM. Event callbacks can call preventDefault on the event object to prevent the page from being removed.
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\events.html jQuery Mobile Docs - Events

Events

Home Search

jQuery Mobile offers several custom events that build upon native events to create useful hooks for development. Note that these events employ various touch, mouse, and window events, depending on event existence, so you can bind to them for use in both handheld and desktop environments. You can bind to these events like you would with other jQuery events, using live() or bind().

Important: Use $(document).bind('pageinit'), not $(document).ready()

The first thing you learn in jQuery is to call code inside the $(document).ready() function so everything will execute as soon as the DOM is loaded. However, in jQuery Mobile, Ajax is used to load the contents of each page into the DOM as you navigate, and the DOM ready handler only executes for the first page. To execute code whenever a new page is loaded and created, you can bind to the pageinit event. This event is explained in detail at the bottom of this page.

 

Important: $(document).bind('pagecreate') vs $(document).bind('pageinit')

Prior to Beta 2 the recommendation to users wishing to manipulate jQuery Mobile enhanced page and child widget markup was to bind to the pagecreate event. In Beta 2 an internal change was made to decouple each of the widgets by binding to the pagecreate event in place of direct calls to the widget methods. As a result, users binding to the pagecreate in mobileinit would find their binding executing before the markup had been enhanced by each of the plugins. In keeping with the lifecycle of the jQuery UI Widget Factory, the initialization method is invoked after the create method, so the pageinit event provides the correct timing for post enhancement manipulation of the DOM and/or Javascript objects. In short, if you were previously using pagecreate to manipulate the enhanced markup before the page was shown, it's very likely you'll want to migrate to 'pageinit'.

Touch events

tap

Triggers after a quick, complete touch event.

taphold

Triggers after a held complete touch event (close to one second).

  • $.event.special.tap.tapholdThreshold (default: 750ms) – This value dictates how long the user must hold their tap before the taphold event is fired on the target element.
swipe

Triggers when a horizontal drag of 30px or more (and less than 75px vertically) occurs within 1 second duration but these can be configured:

  • $.event.special.swipe.scrollSupressionThreshold (default: 10px) – More than this horizontal displacement, and we will suppress scrolling.
  • $.event.special.swipe.durationThreshold (default: 1000ms) – More time than this, and it isn’t a swipe.
  • $.event.special.swipe.horizontalDistanceThreshold (default: 30px) – Swipe horizontal displacement must be more than this.
  • $.event.special.swipe.verticalDistanceThreshold (default: 75px) – Swipe vertical displacement must be less than this.
swipeleft
Triggers when a swipe event occurred moving in the left direction.
swiperight
Triggers when a swipe event occurred moving in the right direction.

Virtual mouse events

We provide a set of "virtual" mouse events that attempt to abstract away mouse and touch events. This allows the developer to register listeners for the basic mouse events, such as mousedown, mousemove, mouseup, and click, and the plugin will take care of registering the correct listeners behind the scenes to invoke the listener at the fastest possible time for that device. In touch environments, the plugin retains the order of event firing that is seen in traditional mouse environments, so for example, vmouseup is always dispatched before vmousedown, and vmousedown before vclick, etc. The virtual mouse events also normalize how coordinate information is extracted from the event, so in touch based environments, coordinates are available from the pageX, pageY, screenX, screenY, clientX, and clientY properties, directly on the event object.

vmouseover
Normalized event for handling touch or mouseover events
vmouseout
Normalized event for handling touch or mouseout events
vmousedown
Normalized event for handling touchstart or mousedown events
vmousemove
Normalized event for handling touchmove or mousemove events
vmouseup
Normalized event for handling touchend or mouseup events
vclick
Normalized event for handling touchend or mouse click events. On touch devices, this event is dispatched *AFTER* vmouseup.
vmousecancel
Normalized event for handling touch or mouse mousecancel events

Warning: Use vclick with caution

Use vclick with caution on touch devices. Webkit based browsers synthesize mousedown, mouseup, and click events roughly 300ms after the touchend event is dispatched. The target of the synthesized mouse events are calculated at the time they are dispatched and are based on the location of the touch events and, in some cases, the implementation specific heuristics which leads to different target calculations on different devices and even different OS versions for the same device. This means the target element within the original touch events could be different from the target element within the synthesized mouse events.

We recommend using click instead of vclick anytime the action being triggered has the possibility of changing the content underneath the point that was touched on screen. This includes page transitions and other behaviors such as collapse/expand that could result in the screen shifting or content being completely replaced.

 

Canceling an elements default click behavior

Applications can call preventDefault() on a vclick event to cancel an element's default click behavior. On mouse based devices, calling preventDefault() on a vclick event equates to calling preventDefault() on the real click event during the bubble event phase. On touch based devices, it's a bit more complicated since the actual click event is dispatched about 300ms after the vclick event is dispatched. For touch devices, calling preventDefault() on a vclick event triggers some code in the vmouse plugin that attempts to catch the next click event that gets dispatched by the browser, during the capture event phase, and calls preventDefault() and stopPropagation() on it. As mentioned in the warning above, it is sometimes difficult to match up a touch event with its corresponding mouse event because the targets can differ. For this reason, the vmouse plugin also falls back to attempting to identify a corresponding click event by coordinates. There are still cases where both target and coordinate identification fail, which results in the click event being dispatched and either triggering the default action of the element, or in the case where content has been shifted or replaced, triggering a click on a different element. If this happens on a regular basis for a given element/control, we suggest you use click for triggering your action.

Orientation change event

orientationchange
Triggers when a device orientation changes (by turning it vertically or horizontally). When bound to this event, the callback function has one argument, the event object. The event object contains an orientation property equal to either "portrait" or "landscape". Note that we currently bind to the resize event when orientationchange is not natively supported, or when $.mobile.orientationChangeEnabled is set to false.

orientationchange timing

The timing of the orientationchange with relation to the change of the client height and width is different between browsers, though the current implementation will give you the correct value for event.orientation derived from window.orientation. This means that if your bindings are dependent on the height and width values you may want to disable orientationChange all together with $.mobile.orientationChangeEnabled = false to let the fallback resize code trigger your bindings.

Scroll events

scrollstart
Triggers when a scroll begins. Note that iOS devices freeze DOM manipulation during scroll, queuing them to apply when the scroll finishes. We're currently investigating ways to allow DOM manipulations to apply before a scroll starts.
scrollstop
Triggers when a scroll finishes.

Page load events

Whenever an external page is loaded into the application DOM, 2 events are fired. The first is pagebeforeload. The 2nd event will be either pageload or pageloadfailed.

pagebeforeload

Triggered before any load request is made. Callbacks bound to this event can call preventDefault() on the event to indicate that they are handling the load request. Callbacks that do this *MUST* make sure they call resolve() or reject() on the deferred object reference contained in the data object passed to the callback.

The data object, passed as the 2nd arg to the callback function contains the following properties:

  • url (string)
    • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
  • absUrl (string)
    • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
  • dataUrl (string)
    • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
  • deferred (object)
    • Callbacks that call preventDefault() on the event, *MUST* call resolve() or reject() on this object so that changePage() requests resume processing. Deferred object observers expect the deferred object to be resolved like this:

      
      $( document ).bind( "pagebeforeload", function( event, data ){
      
      	// Let the framework know we're going to handle the load.
      
      	event.preventDefault();
      
      	// ... load the document then insert it into the DOM ...
      	// at some point, either in this callback, or through
      	// some other async means, call resolve, passing in
      	// the following args, plus a jQuery collection object
      	// containing the DOM element for the page.
      
      	data.deferred.resolve( data.absUrl, data.options, page );
      
      });

      or rejected like this:

      
      $( document ).bind( "pagebeforeload", function( event, data ){
      
      	// Let the framework know we're going to handle the load.
      
      	event.preventDefault();
      
      	// ... load the document then insert it into the DOM ...
      	// at some point, if the load fails, either in this
      	// callback, or through some other async means, call
      	// reject like this:
      
      	data.deferred.reject( data.absUrl, data.options );
      
      });
  • options (object)
    • This object contains the options that were passed into $.mobile.loadPage().
pageload
Triggered after the page is successfully loaded and inserted into the DOM. Callbacks bound to this event will be passed a data object as its 2nd arg. This object contains the following information:
  • url (string)
    • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
  • absUrl (string)
    • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
  • dataUrl (string)
    • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
  • options (object)
    • This object contains the options that were passed into $.mobile.loadPage().
  • xhr (object)
    • The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the 3rd argument to the framework's $.ajax() success callback.
  • textStatus (null or string)
    • According to the jQuery Core documentation, this will be a string describing the status. This is what gets passed as the 2nd argument to the framework's $.ajax() error callback.
pageloadfailed
Triggered if the page load request failed. By default, after dispatching this event, the framework will display a page failed message and call reject() on the deferred object contained within the event's data object. Callbacks can prevent this default behavior from executing by calling preventDefault() on the event.

The data object, passed as the 2nd arg to the callback function contains the following properties:

  • url (string)
    • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
  • absUrl (string)
    • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
  • dataUrl (string)
    • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
  • deferred (object)
    • Callbacks that call preventDefault() on the event, *MUST* call resolve() or reject() on this object so that changePage() requests resume processing. Deferred object observers expect the deferred object to be resolved like this:

      
      $( document ).bind( "pageloadfailed", function( event, data ){
      
      	// Let the framework know we're going to handle things.
      
      	event.preventDefault();
      
      	// ... attempt to load some other page ...
      	// at some point, either in this callback, or through
      	// some other async means, call resolve, passing in
      	// the following args, plus a jQuery collection object
      	// containing the DOM element for the page.
      
      	data.deferred.resolve( data.absUrl, data.options, page );
      
      });

      or rejected like this:

      
      $( document ).bind( "pageloadfailed", function( event, data ){
      
      	// Let the framework know we're going to handle things.
      
      	event.preventDefault();
      
      	// ... attempt to load some other page ...
      	// at some point, if the load fails, either in this
      	// callback, or through some other async means, call
      	// reject like this:
      
      	data.deferred.reject( data.absUrl, data.options );
      
      });
  • options (object)
    • This object contains the options that were passed into $.mobile.loadPage().
  • xhr (object)
    • The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the first argument to the framework's $.ajax() error callback.
  • textStatus (null or string)
    • According to the jQuery Core documentation, possible values for this property, aside from null, are "timeout", "error", "abort", and "parsererror". This is what gets passed as the 2nd argument to the framework's $.ajax() error callback.
  • errorThrown (null, string, object)
    • According to the jQuery Core documentation, this property may be an exception object if one occurred, or if an HTTP error occurred this will be set to the textual portion of the HTTP status. This is what gets passed as the 3rd argument to the framework's $.ajax() error callback.

Page change events

Navigating between pages in the application is usually accomplished through a call to $.mobile.changePage(). This function is responsible for making sure that the page we are navigating to is loaded and inserted into the DOM, and then kicking off the transition animations between the current active page, and the page the caller wants to make active. During this process, which is usually asynchronous, changePage() will fire off 2 events. The first is pagebeforechange. The second event depends on the success or failure of the change request. It will either be pagechange or pagechangefailed.

pagebeforechange
This event is triggered prior to any page loading or transition. Callbacks can prevent execution of the changePage() function by calling preventDefault on the event object passed into the callback. The callback also recieves a data object as its 2nd arg. The data object has the following properties:
  • toPage (object or string)
    • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
  • options (object)
    • This object contains the configuration options to be used for the current changePage() call.

It should be noted that callbacks can modify both the toPage and options properties to alter the behavior of the current changePage() call. So for example, the toPage can be mapped to a different url from within a callback to do a sort of redirect.

pagechange
This event is triggered after the changePage() request has finished loading the page into the DOM and all page transition animations have completed. Note that any pageshow or pagehide events will have fired *BEFORE* this event is triggered. Callbacks for this particular event will be passed a data object as the 2nd arg. The properties for this object are as follows:
  • toPage (object or string)
    • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
  • options (object)
    • This object contains the configuration options to be used for the current changePage() call.
pagechangefailed
This event is triggered when the changePage() request fails to load the page. Callbacks for this particular event will be passed a data object as the 2nd arg. The properties for this object are as follows:
  • toPage (object or string)
    • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
  • options (object)
    • This object contains the configuration options to be used for the current changePage() call.

Page transition events

Page transitions are used to animate the change from the current active page (fromPage) to a new page (toPage). Events are triggered before and after these transitions so that observers can be notified whenever pages are shown or hidden. The events triggered are as follows:

pagebeforeshow
Triggered on the "toPage" we are transitioning to, before the actual transition animation is kicked off. Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it:
  • prevPage (object)
    • A jQuery collection object that contains the page DOM element that we are transitioning away from. Note that this collection is empty when the first page is transitioned in during application startup.
pagebeforehide
Triggered on the "fromPage" we are transitioning away from, before the actual transition animation is kicked off. Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it:
  • nextPage (object)
    • A jQuery collection object that contains the page DOM element that we are transitioning to.

Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.

pageshow
Triggered on the "toPage" after the transition animation has completed. Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it:
  • prevPage (object)
    • A jQuery collection object that contains the page DOM element that we just transitioned away from. Note that this collection is empty when the first page is transitioned in during application startup.
pagehide
Triggered on the "fromPage" after the transition animation has completed. Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it:
  • nextPage (object)
    • A jQuery collection object that contains the page DOM element that we just transitioned to.

Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.

You can access the prevPage or nextPage properties via the second argument of a bound callback function. For example:


$( 'div' ).live( 'pageshow',function(event, ui){
  alert( 'This page was just hidden: '+ ui.prevPage);
});

$( 'div' ).live( 'pagehide',function(event, ui){
  alert( 'This page was just shown: '+ ui.nextPage);
});

Also, for these handlers to be invoked during the initial page load, you must bind them before jQuery Mobile executes. This can be done in the mobileinit handler, as described on the global config page.

Page initialization events

Internally, jQuery Mobile auto-initializes plugins based on the markup conventions found in a given "page". For example, an input element with a type of range will automatically generate a custom slider control.

This auto-initialization is controlled by the "page" plugin, which dispatches events before and after it executes, allowing you to manipulate a page either pre-or-post initialization, or even provide your own initialization behavior and prevent the auto-initializations from occurring. Note that these events will only fire once per "page", as opposed to the show/hide events, which fire every time a page is shown and hidden.

pagebeforecreate

Triggered on the page being initialized, before most plugin auto-initialization occurs.


$( '#aboutPage' ).live( 'pagebeforecreate',function(event){
  alert( 'This page was just inserted into the dom!' );
});

Note that by binding to pagebeforecreate, you can manipulate markup before jQuery Mobile's default widgets are auto-initialized. For example, say you want to add data-attributes via JavaScript instead of in the HTML source, this is the event you'd use.


$( '#aboutPage' ).live( 'pagebeforecreate',function(event){
  // manipulate this page before its widgets are auto-initialized
});
pagecreate

Triggered when the page has been created in the DOM (via ajax or other) but before all widgets have had an opportunity to enhance the contained markup. This event is most useful for user's wishing to create their own custom widgets for child markup enhancement as the jquery mobile widgets do.


$( '#aboutPage' ).live( 'pagecreate',function(event){
  ( ":jqmData(role='sweet-plugin')" ).sweetPlugin();
});
pageinit

Triggered on the page being initialized, after initialization occurs. We recommend binding to this event instead of DOM ready() because this will work regardless of whether the page is loaded directly or if the content is pulled into another page as part of the Ajax navigation system.


$( '#aboutPage' ).live( 'pageinit',function(event){
  alert( 'This page was just enhanced by jQuery Mobile!' );
});

Page remove events

By default, the framework removes any non active dynamically loaded external pages from the DOM as soon as the user navigates away to a different page. The pageremove event is dispatched just before the framework attempts to remove the a page from the DOM.

pageremove
This event is triggered just before the framework attempts to remove an external page from the DOM. Event callbacks can call preventDefault on the event object to prevent the page from being removed.

Layout events

Some components within the framework, such as collapsible and listview search, dynamically hide and show content based on user events. This hiding/showing of content affects the size of the page and may result in the browser adjusting/scrolling the viewport to accommodate the new page size. Since this has the potential to affect other components such as fixed headers and footers, components like collapsible and listview trigger a custom updatelayout event to notify other components that they may need to adjust their layouts in response to their content changes. Developers who are building dynamic applications that inject, hide, or remove content from the page, or manipulate it in any way that affects the dimensions of the page, can also manually trigger this updatelayout event to ensure components on the page update in response to the changes.

updatelayout
This event is triggered by components within the framework that dynamically show/hide content, and is meant as a generic mechanism to notify other components that they may need to update their size or position. Within the framework, this event is fired on the component element whose content was shown/hidden, and bubbles all the way up to the document element.

$( '#foo' ).hide().trigger( 'updatelayout' );

Animation Events

jQuery Mobile exposes the animationComplete plugin, which you can utilize after adding or removing a class that applies a CSS transition. It can be used with page transition events. For example:


$(document).bind("pagehide", function(event, ui) {
  $(ui.nextPage).animationComplete(function() {
    alert('Animation completed');
  });
});
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\globalconfig.html jQuery Mobile Docs - Configuring default settings

Configuring Defaults

Home Search

Working with jQuery Mobile's Auto-initialization

Unlike other jQuery projects, such as jQuery and jQuery UI, jQuery Mobile automatically applies many markup enhancements as soon as it loads (long before the document.ready event fires). These enhancements are applied based on jQuery Mobile's default settings, which are designed to work with common scenarios. If changes to the settings are needed, they are easy to configure.

The mobileinit event

When jQuery Mobile starts, it triggers a mobileinit event on the document object. To override default settings, bind to mobileinit.

				
$(document).bind("mobileinit", function(){
  //apply overrides here
});
				
			

Because the mobileinit event is triggered immediately, you'll need to bind your event handler before jQuery Mobile is loaded. Link to your JavaScript files in the following order:

				
<script src="jquery.js"></script>
<script src="custom-scripting.js"></script>
<script src="jquery-mobile.js"></script>
				
			

You can override default settings by extending the $.mobile object using jQuery's $.extend method.

				
$(document).bind("mobileinit", function(){
  $.extend(  $.mobile , {
    foo: bar
  });
});
				
			

Alternatively, you can set them using object property notation.

				
$(document).bind("mobileinit", function(){
  $.mobile.foo = bar;
});
				
			

To explore the effects of global configuration options, see the config test pages.

Configurable options

The following defaults are configurable via the $.mobile object:

activeBtnClass string, default: "ui-btn-active"
The CSS class used for "active" button state.
activePageClass string, default: "ui-page-active"
The CSS class used for the page currently in view or in a transition.
ajaxEnabled boolean, default: true
jQuery Mobile will automatically handle link clicks and form submissions through Ajax, when possible. If false, URL hash listening will be disabled as well, and URLs will load as ordinary HTTP requests.
allowCrossDomainPages boolean, default: false
When jQuery Mobile attempts to load an external page, the request runs through $.mobile.loadPage(). This will only allow cross-domain requests if $.mobile.allowCrossDomainPages is set to true. Because the jQuery Mobile framework tracks what page is being viewed within the browser's location hash, it is possible for a cross-site scripting (XSS) attack to occur if the XSS code in question can manipulate the hash and set it to a cross-domain URL of its choice. This is the main reason that the default setting for $.mobile.allowCrossDomainPages is set to false. In PhoneGap apps that must "phone home" by loading assets off a remote server, both the $.support.cors AND $.mobile.allowCrossDomainPages must be set to true.
autoInitializePage boolean, default: true
When the DOM is ready, the framework should automatically call $.mobile.initializePage. If false, the page will not initialize and will be visually hidden until $.mobile.initializePage is manually called.
buttonMarkup.hoverDelay integer, default: 200
Set the delay for touch devices to add the hover and down classes on touch interactions for buttons throughout the framework. Reducing the delay here results in a more responsive feeling ui, but will often result in the downstate being applied during page scrolling.
defaultDialogTransition string, default: 'pop'
Set the default transition for dialog changes that use Ajax. Set to 'none' for no transitions.
defaultPageTransition string, default: 'fade'
Set the default transition for page changes that use Ajax. Note: default changed from 'slide' to 'fade' in 1.1. Set to 'none' for no transitions.
gradeA function that returns a boolean, default: a function returning the value of $.support.mediaquery
Any support conditions that must be met in order to proceed.
hashListeningEnabled boolean, default: true
jQuery Mobile will automatically listen and handle changes to the location.hash. Disabling this will prevent jQuery Mobile from handling hash changes, which allows you to handle them yourself or use simple deep-links within a document that scroll to a particular id.
ignoreContentEnabled boolean, default: false
Warning: Setting this property to true will cause performance degradation on enhancement. Once set, all automatic enhancements made by the framework to each enhanceable element of the user's markup will first check for a data-enhance=false parent node. If one is found the markup will be ignored. This setting and the accompanying data attribute provide a mechanism through which users can prevent enhancement over large sections of markup.
linkBindingEnabled boolean, default: true
jQuery Mobile will automatically bind the clicks on anchor tags in your document. Setting this options to false will prevent all anchor click handling including the addition of active button state and alternate link bluring. This should only be used when attempting to delegate the click management to another library or custom code.
loadingMessage string, default: "loading"
Set the text that appears when a page is loading. If set to false, the message will not appear at all.
loadingMessageTextVisible boolean, default: false
Whether the text should be visible when a loading message is shown. The text is always visible for loading errors.
loadingMessageTheme string, default: "a"
The theme that the loading message box uses when text is visible.
minScrollBack integer, default: 250
Minimum scroll distance that will be remembered when returning to a page.
ns string, default: ""
The namespace used in data- attributes (e.g., data-role). Can be set to any string, including a blank string which is the default. When using, it's clearest if you include a trailing dash, such as "mynamespace-" which maps to data-mynamespace-foo="...".

If you use data- namespacing, you will need to update/override one selector in the theme CSS. The following data selectors should incorporate the namespace you're using:


.ui-mobile [data-mynamespace-role=page], .ui-mobile [data-mynamespace-role=dialog], .ui-page { ...
		

pageLoadErrorMessage string, default: "Error Loading Page"
Set the text that appears when a page fails to load through Ajax.
pageLoadErrorMessageTheme string, default: "e"
Set the theme that the error message box uses.
pushStateEnabled boolean, default: true
Enhancement to use history.replaceState in supported browsers, to convert the hash-based Ajax URL into the full document path. Note that we recommend disabling this feature if Ajax is disabled or if extensive use of external links are used.
subPageUrlKey string, default: "ui-page"
The url parameter used for referencing widget-generated sub-pages (such as those generated by nested listviews). Translates to example.html&ui-page=subpageIdentifier. The hash segment before &ui-page= is used by the framework for making an Ajax request to the URL where the sub-page exists.
touchOverflowEnabled boolean, default: false
Enable smoother page transitions and true fixed toolbars in devices that support both the overflow: and overflow-scrolling: touch; CSS properties.

Deprecated in 1.1.0

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\index.html jQuery UI Mobile Framework - API

API

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\mediahelpers.html jQuery Mobile Docs - Responsive Layout Helpers

Responsive Layout Helpers

Home Search

Media Query Helper Classes

Note: This feature was deprecated in beta, and removed in 1.0rc1. We recommend using CSS3 Media Queries instead. To support older versions of Internet Explorer, check out respond.js, a fast & lightweight polyfill for min/max-width CSS3 Media Queries.

If you still need this feature, you can find the code here: jquery.mobile.media.classes.js

jQuery Mobile adds classes to the HTML element that mimic browser orientation and common min/max-width CSS media queries. These classes are updated on load, resize and orientationchange, allowing you to key off these classes in your CSS, to create responsive layouts - even in browsers that don't support media queries!

Orientation Classes

The HTML element will always have a class of either "portrait" or "landscape", depending on the orientation of the browser or device. You can utilize these in your CSS like this:

			
.portrait {
	/* portrait orientation changes go here! */
}
.landscape {
	/* landscape orientation changes go here! */
}			
			
			

Min/Max Width Breakpoint Classes

By default, we create min and max breakpoint classes at the following widths: 320,480,768,1024. These translate to classes that look like this: "min-width-320px", "max-width-480px", and are meant to be used as a replacement of (or in addition to) the media query equivalents they mimic.

			
.myelement { 
	float: none;
}			
.min-width-480px .myelement {
	float: left;
}		
			

Many plugins in jQuery Mobile leverage these width breakpoints. For example, form elements float beside their labels when the browser is wider than 480 pixels. The CSS to support this behavior for form text inputs looks like this:

			
label.ui-input-text { 
	display: block; 
}
.min-width-480px label.ui-input-text { 
	display: inline-block; 
}
			

Adding Width Breakpoints

To utilize width breakpoints of your own, jQuery Mobile exposes the $.mobile.addResolutionBreakpoints function, which accepts either a single number or array of numbers that will be added to the min/max breakpoints whenever they apply.

			
//add a min/max class for 1200 pixel widths			
$.mobile.addResolutionBreakpoints(1200);

//add min/max classes for 1200, and 1440 pixel widths			
$.mobile.addResolutionBreakpoints([1200, 1440]);
			

Running Media Queries

jQuery Mobile provides a function that allows you to test whether a particular CSS Media Query applies. Simple call $.mobile.media() and pass a media type or query. If the browser supports that type or query, and it currently applies, the function will return true. If not, it'll return false.

			
//test for screen media type
$.mobile.media("screen");

//test  a min-width media query
$.mobile.media("screen and (min-width: 480px)");

//test for iOS retina display
$.mobile.media("screen and (-webkit-min-device-pixel-ratio: 2)");

			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\methods.html jQuery Mobile Docs - Methods

Methods

Home Search

jQuery Mobile exposes several methods and properties on the $.mobile object for use in your applications.

$.mobile.changePage (method)
Programmatically change from one page to another. This method is used internally for the page loading and transitioning that occurs as a result of clicking a link or submitting a form, when those features are enabled.
· Arguments
to (string or object, required)
  • String: Absolute or relative URL. ("about/us.html")
  • Object: jQuery collection object. ($("#about"))
options (object, optional)
  • Properties:
    • allowSamePageTransition (boolean, default: false) By default, changePage() ignores requests to change to the current active page. Setting this option to true, allows the request to execute. Developers should note that some of the page transitions assume that the fromPage and toPage of a changePage request are different, so they may not animate as expected. Developers are responsible for either providing a proper transition, or turning it off for this specific case.
    • changeHash (boolean, default: true) Decides if the hash in the location bar should be updated.
    • data (object or string, default: undefined) The data to send with an Ajax page request.
      • Used only when the 'to' argument of changePage() is a URL.
    • dataUrl (string, default: undefined) The URL to use when updating the browser location upon changePage completion. If not specified, the value of the data-url attribute of the page element is used.
    • pageContainer (jQuery collection, default: $.mobile.pageContainer) Specifies the element that should contain the page.
    • reloadPage (boolean, default: false) Forces a reload of a page, even if it is already in the DOM of the page container.
      • Used only when the 'to' argument of changePage() is a URL.
    • reverse (boolean, default: false) Decides what direction the transition will run when showing the page.
    • role (string, default: undefined) The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element.
    • showLoadMsg (boolean, default: true) Decides whether or not to show the loading message when loading external pages.
    • transition (string, default: $.mobile.defaultPageTransition) The transition to use when showing the page.
    • type (string, default: "get") Specifies the method ("get" or "post") to use when making a page request.
      • Used only when the 'to' argument of changePage() is a URL.
Examples:
			
//transition to the "about us" page with a slideup transition
$.mobile.changePage( "about/us.html", { transition: "slideup"} );

//transition to the "search results" page, using data from a form with an id of "search"
$.mobile.changePage( "searchresults.php", {
	type: "post",
	data: $("form#search").serialize()
});

//transition to the "confirm" page with a "pop" transition without tracking it in history	
$.mobile.changePage( "../alerts/confirm.html", {
	transition: "pop",
	reverse: false,
	changeHash: false
});

			
			
$.mobile.loadPage (method)
Load an external page, enhance its content, and insert it into the DOM. This method is called internally by the changePage() function when its first argument is a URL. This function does not affect the current active page so it can be used to load pages in the background. The function returns a deferred promise object that gets resolved after the page has been enhanced and inserted into the document.
· Arguments
url (string or object, required) A relative or absolute URL.
options (object, optional)
  • Properties:
    • data (object or string, default: undefined) The data to send with an Ajax page request.
    • loadMsgDelay (number (in ms), default: 50) Forced delay before the loading message is shown. This is meant to allow time for a page that has already been visited to be fetched from cache without a loading message.
    • pageContainer (jQuery collection, default: $.mobile.pageContainer) Specifies the element that should contain the page after it is loaded.
    • reloadPage (boolean, default: false) Forces a reload of a page, even if it is already in the DOM of the page container.
    • role (string, default: undefined) The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element.
    • type (string, default: "get") Specifies the method ("get" or "post") to use when making a page request.
Examples:
			
//load the "about us" page into the DOM
$.mobile.loadPage( "about/us.html" );

//load a "search results" page, using data from a form with an id of "search"
$.mobile.loadPage( "searchresults.php", {
	type: "post",
	data: $("form#search").serialize()
});
			
			
$.fn.jqmData(), $.fn.jqmRemoveData() (method)
When working with jQuery Mobile, jqmData and jqmRemoveData should be used in place of jQuery core's data and removeData methods (note that this includes $.fn.data, $.fn.removeData, and the $.data, $.removeData, and $.hasData utilities), as they automatically incorporate getting and setting of namespaced data attributes (even if no namespace is currently in use).
· Arguments:
See jQuery's data and removeData methods
Note: Calling jqmData() with no argument will return undefined. This behavior is subject to change in future versions.
· Also:
When finding elements by their jQuery Mobile data attribute, please use the custom selector :jqmData(), as it automatically incorporates namespaced data attributes into the lookup when they are in use. For example, instead of calling $("div[data-role='page']"), you should use $("div:jqmData(role='page')"), which internally maps to $("div[data-"+ $.mobile.ns +"role='page']") without forcing you to concatenate a namespace into your selectors manually.
$.fn.jqmEnhanceable() (method)
For users that wish to respect data-enhance=false parent elements during manual enhancement or custom plugin authoring jQuery Mobile provides the $.fn.jqmEnhanceable filter method.
· Settings:
If, and only if, $.mobile.ignoreContentEnabled is set to true, this method will traverse the parent nodes for each DOM element in the jQuery object and where it finds a data-enhance=false parent the child will be removed from the set.
· Warning:
The operation of traversing all parent elements can be expensive for even small jQuery object sets.
$.fn.jqmHijackable() (method)
For users that wish to respect data-ajax=false parent elements during custom form and link binding jQuery Mobile provides the $.fn.jqmHijackable filter method.
· Settings:
If, and only if, $.mobile.ignoreContentEnabled is set to true, this method will traverse the parent nodes for each DOM element in the jQuery object and where it finds a data-ajax=false parent the child form or link will be removed from the set.
· Warning:
The operation of traversing all parent elements can be expensive for even small jQuery object sets.
$.mobile.showPageLoadingMsg (method)
Show the page loading message, which is configurable via $.mobile.loadingMessage.
· Arguments
theme (string, default: "a") The theme swatch for the message.
msgText (string, default: "loading") The text of the message.
textonly (boolean, default: false) If true, the "spinner" image will be hidden when the message is shown.
Examples:
			
//cue the page loader
$.mobile.showPageLoadingMsg();

//use theme swatch "b", a custom message, and no spinner
$.mobile.showPageLoadingMsg("b", "This is only a test", true);
			
			
$.mobile.hidePageLoadingMsg (method)
Hide the page loading message, which is configurable via $.mobile.loadingMessage.
Example:
			
//hide the page loader
$.mobile.hidePageLoadingMsg();
			
			
$.mobile.fixedToolbars.show (method)
Utility method for displaying the fixed header and/or footer of the current active page within the viewport. Note that fixed headers/footers are never really hidden. Toggling the show/hide state of a toolbar is really toggling whether or not they are inline within the page content, or displayed within the viewport as if they were fixed.
· Arguments
immediately (boolean, optional) If true, any fixed header or footer for the current active page is displayed immediately within the viewport. If false or unspecified, the fixed header/footer will fade-in after a 100 millisecond delay. Note that other events such as a document resize or scroll event can result in an additional delay before the start of the header/footer display animation.
Example:
			
// Show fixed header/footer with a fade animation.
$.mobile.fixedToolbars.show();

// Show fixed header/footer immediately.
$.mobile.fixedToolbars.show(true);
			
			
$.mobile.fixedToolbars.hide (method)
Utility method for hiding the fixed header and/or footer of the current active page.
· Arguments
immediately (boolean, optional) If true, any fixed header or footer for the current active page is immediately placed inline (back in flow) with the page content, which means it will scroll along with the content and will only be visible when viewing the top or bottom of the page within the viewport. If false or unspecified, the fixed header/footer will fade-out after a 100 millisecond delay. Note that other events such as a document resize or scroll event can result in the header/footer being immediately hidden.
Example:
			
// Hide fixed header/footer with a fade animation.
$.mobile.fixedToolbars.hide();

// Hide fixed header/footer immediately.
$.mobile.fixedToolbars.hide(true);
			
			
$.mobile.path.parseUrl (method)
Utility method for parsing a URL and its relative variants into an object that makes accessing the components of the URL easy. When parsing relative variants, the resulting object will contain empty string values for missing components (like protocol, host, etc). Also, when parsing URLs that have no authority, such as tel: urls, the pathname property of the object will contain the data after the protocol/scheme colon.
· Arguments
url (string, required) A relative or absolute URL.
· Return Value

This function returns an object that contains the various components of the URL as strings. The properties on the object mimic the browser's location object:

hash
The fragment component of the URL, including the leading '#' character.
host
The host and port number of the URL.
hostname
The name of the host within the URL.
href
The original URL that was parsed.
pathname
The path of the file or directory referenced by the URL.
port
The port specified within the URL. Most URLs rely on the default port for the protocol used, so this may be an empty string most of the time.
protocol
The protocol for the URL including the trailing ':' character.
search
The query component of the URL including the leading '?' character.

But it also contains additional properties that provide access to additional components as well as some common forms of the URL developers access:

authority
The username, password, and host components of the URL
directory
The directory component of the pathname, minus any filename.
domain
The protocol and authority components of the URL.
filename
The filename within the pathname component, minus the directory.
hrefNoHash
The original URL minus the fragment (hash) components.
hrefNoSearch
The original URL minus the query (search) and fragment (hash) components.
password
The password contained within the authority component.
username
The username contained within the authority component.
Examples:
			
// Parsing the Url below results an object that is returned with the
// following properties:
//
//  obj.href:         http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content
//  obj.hrefNoHash:   http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread
//  obj.hrefNoSearch: http://jblas:password@mycompany.com:8080/mail/inbox
//  obj.domain:       http://jblas:password@mycompany.com:8080
//  obj.protocol:     http:
//  obj.authority:    jblas:password@mycompany.com:8080
//  obj.username:     jblas
//  obj.password:     password
//  obj.host:         mycompany.com:8080
//  obj.hostname:     mycompany.com
//  obj.port:         8080
//  obj.pathname:     /mail/inbox
//  obj.directory:    /mail/
//  obj.filename:     inbox
//  obj.search:       ?msg=1234&type=unread
//  obj.hash:         #msg-content

var obj = $.mobile.path.parseUrl("http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234");
			
			
$.mobile.path.makePathAbsolute (method)
Utility method for converting a relative file or directory path into an absolute path.
· Arguments
relPath (string, required) A relative file or directory path.
absPath (string, required) An absolute file or relative path to resolve against.
· Return Value
This function returns a string that is an absolute version of the relative path passed in.
Examples:
			
// Returns: /a/b/c/file.html
var absPath = $.mobile.path.makePathAbsolute("file.html", "/a/b/c/bar.html");

// Returns: /a/foo/file.html
var absPath = $.mobile.path.makePathAbsolute("../../foo/file.html", "/a/b/c/bar.html");

			
			
$.mobile.path.makeUrlAbsolute (method)
Utility method for converting a relative URL to an absolute URL.
Arguments
relUrl (string, required) A relative URL.
absUrl (string, required) An absolute URL to resolve against.
Return Value
This function returns a string that is an absolute version of the relative URL passed in.
Examples:
			
// Returns: http://foo.com/a/b/c/file.html
var absUrl = $.mobile.path.makeUrlAbsolute("file.html", "http://foo.com/a/b/c/test.html");

// Returns: http://foo.com/a/foo/file.html
var absUrl = $.mobile.path.makeUrlAbsolute("../../foo/file.html", "http://foo.com/a/b/c/test.html");

// Returns: http://foo.com/bar/file.html
var absUrl = $.mobile.path.makeUrlAbsolute("//foo.com/bar/file.html", "http://foo.com/a/b/c/test.html");

// Returns: http://foo.com/a/b/c/test.html?a=1&b=2
var absUrl = $.mobile.path.makeUrlAbsolute("?a=1&b=2", "http://foo.com/a/b/c/test.html");

// Returns: http://foo.com/a/b/c/test.html#bar
var absUrl = $.mobile.path.makeUrlAbsolute("#bar", "http://foo.com/a/b/c/test.html");

			
			
$.mobile.path.isSameDomain (method)
Utility method for comparing the domain of 2 URLs.
· Arguments
url1 (string, required) A relative URL.
url2 (string, required) An absolute URL to resolve against.
Return Value
This function returns a boolean true if the domains match, false if they don't.
Examples:
			
// Returns: true
var same = $.mobile.path.isSameDomain("http://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");

// Returns: false
var same = $.mobile.path.isSameDomain("file://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");

// Returns: false
var same = $.mobile.path.isSameDomain("https://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");

// Returns: false
var same = $.mobile.path.isSameDomain("http://foo.com/a/file.html", "http://bar.com/a/b/c/test.html");

			
			
$.mobile.path.isRelativeUrl (method)
Utility method for determining if a URL is a relative variant.
· Arguments
url (string, required) A relative or absolute URL.
· Return Value
This function returns a boolean true if the URL is relative, false if it is absolute.
Examples:
			
// Returns: false
var isRel = $.mobile.path.isRelativeUrl("http://foo.com/a/file.html");

// Returns: true
var isRel = $.mobile.path.isRelativeUrl("//foo.com/a/file.html");

// Returns: true
var isRel = $.mobile.path.isRelativeUrl("/a/file.html");

// Returns: true
var isRel = $.mobile.path.isRelativeUrl("file.html");

// Returns: true
var isRel = $.mobile.path.isRelativeUrl("?a=1&b=2");

// Returns: true
var isRel = $.mobile.path.isRelativeUrl("#foo");


			
			
$.mobile.path.isAbsoluteUrl (method)
Utility method for determining if a URL is absolute.
· Arguments
url (string, required) A relative or absolute URL.
· Return Value
This function returns a boolean true if the URL is absolute, false if not.
Examples:
			
// Returns: true
var isAbs = $.mobile.path.isAbsoluteUrl("http://foo.com/a/file.html");

// Returns: false
var isAbs = $.mobile.path.isAbsoluteUrl("//foo.com/a/file.html");

// Returns: false
var isAbs = $.mobile.path.isAbsoluteUrl("/a/file.html");

// Returns: false
var isAbs = $.mobile.path.isAbsoluteUrl("file.html");

// Returns: false
var isAbs = $.mobile.path.isAbsoluteUrl("?a=1&b=2");

// Returns: false
var isAbs = $.mobile.path.isAbsoluteUrl("#foo");


			
			
$.mobile.path.get (method)
Utility method for determining the directory portion of an URL. If the URL has no trailing slash, the last component of the URL is considered to be a file.
· Arguments
url (string, required) A relative or absolute URL.
· Return Value
This function returns the directory portion of a given URL.
Examples:
			
// Returns: http://foo.com/a/
var dirName = $.mobile.path.get("http://foo.com/a/file.html");

// Returns: http://foo.com/a/
var dirName = $.mobile.path.get("http://foo.com/a/");

// Returns: http://foo.com/a
var dirName = $.mobile.path.get("http://foo.com/a");

// Returns: //foo.com/a/
var dirName = $.mobile.path.get("//foo.com/a/file.html");

// Returns: /a/
var dirName = $.mobile.path.get("/a/file.html");

// Returns: ""
var dirName = $.mobile.path.get("file.html");

// Returns: /
var dirName = $.mobile.path.get("/file.html");

// Returns: ?a=1&b=2
var dirName = $.mobile.path.get("?a=1&b=2");

// Returns: foo
var dirName = $.mobile.path.isAbsoluteUrl("#foo");


			
			
$.mobile.base (methods, properties)
Utilities for working with generated base element. TODO: document as public API is finalized.
$.mobile.silentScroll (method)
Scroll to a particular Y position without triggering scroll event listeners.
· Arguments:
yPos (number, defaults to 0). Pass any number to scroll to that Y location.
Examples:
			
//scroll to Y 100px
$.mobile.silentScroll(100);
			
			
$.mobile.activePage (property)
Reference to the page currently in view.
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\api\themes.html jQuery Mobile Framework - Static Containers, States

Themes

Home Search

Theming overview

The theming system used in jQuery Mobile is similar to the ThemeRoller system in jQuery UI with a few important improvements:

  • It takes advantage of CSS3 properties to add rounded corners, box and text shadow and gradients instead of images, allowing the theme file to be very lightweight and reducing server requests.
  • Themes include multiple color "swatches" — each consisting of a header bar, content body, and button states that can be freely mixed and matched to create visual texture — to make richer designs possible.
  • Open-ended theming allows for up to 26 unique swatches per theme, to add almost unlimited variety to designs.
  • All backgrounds now use CSS3 gradients to dramatically reduce file size and number of server requests.
  • There is a simplified icon set in a sprite to reduce image weight.

ThemeRoller

Themroller Mobile Logo The easiest way to create custom themes is with the ThemeRoller tool. It allows you to build a theme, then download a custom CSS file, ready to be dropped into your project.

jQuery Mobile default theming

If no theme swatch letter is set at all, the framework uses the a swatch for headers and footers and, for best contrast, the c swatch for the content of a page. All items in this containers inherit the swatch from its parents. One exception is the listdivider in listviews. This always defaults to the b (blue in the default theme). Also there is an swatch named "active" (bright blue in the default theme) which is used to indicate an active selected item. For more information about that, read Global "Active" state on this page.

Themes & swatches

The theme system separates color and texture from structural styles that define things like padding and dimensions. This allows theme colors and textures to be defined once in the stylesheet and to be mixed, matched, and combined to achieve a wide range of visual effects.

Each theme includes several global settings, including font family, drop shadows for overlays, and corner radius values for buttons and boxes. In addition, the theme can include multiple color swatches, each with color values for bars, content blocks, buttons and list items, and font text-shadow.

The default theme includes 5 swatches that are given letters (a, b, c, d, e) for quick reference. To make mapping of color swatches consistent across our widgets, we have followed the convention that swatch "a" is the highest level of visual priority (black in our default theme), "b" is secondary level (blue) and "c" is the baseline level (gray) that we use by default in many situations, "d" for an alternate secondary level and "e" as an accent swatch. Themes may have additional swatches for accent colors or specific situations. For example, you could add a new theme swatch "f" that has a red bar and button for use in error situations.

Most theme changes can be done using ThemeRoller, but it's also simple to manually edit the base swatches in the default theme and/or add additional swatches by editing the theme CSS file. Just copy a block of swatch styles, rename the classes with the new swatch letter name, and tweak colors as you see fit.

Bars

The default theme contains the following five bar styles:

Bar A - Link
Bar B - Link
Bar C - Link
Bar D - Link
Bar E - Link

By default, the framework assigns the "a" swatch to all headers and footers, because these are typically given high visual priority in an application. To set the color of a bar to a different swatch color, simply add the data-theme attribute to your header or footer and specify an alternate swatch letter ('b' or 'd', for example) and the specified theme swatch color will be applied. Learn more about toolbar theming.

Content Blocks

The default theme also includes color swatch values for use in content blocks, designed to coordinate with the header color swatches in the theme.

Block A - Link
Block B - Link
Block C - Link
Block D - Link
Block E - Link

If a theme isn't specified on a content block, the framework will default to "c" to maximize contrast against the default header "a", as shown here:

Back

Default Header

Default Theme Content Header

This is the default content color swatch and a preview of a link.

Cache settings:
Button

Learn more about content theming.

Lists & Buttons

Each swatch also includes default styles for interactive elements like list items and buttons.

A button is included for each swatch in the theme. Each button has styles for normal, hover/focus and pressed states.

By default, any button that's placed in a bar is automatically assigned a swatch letter that matches its parent bar or content box. Thus, the button is visually integrated into the parent theme as shown here:

Bar A

Button A

Bar B

Button B

Bar C

Button C

Bar D

Button D

Bar E

Button E

This default behavior makes it easy to ripple a theme change through a page by setting a theme swatch on a parent because you know the buttons will maintain the same relative visual weight across themes. Since form elements use the button styles, they will also adapt to their parent container.

If you want to add visual emphasis to a button, an alternate swatch color can be set by adding a data-theme="a" to the anchor. Once an alternate swatch color is set on a button in the markup, the framework won't override that color if the parent theme is changed, because you made a conscious decision to set it.

Learn more about list theming and button theming.

Global "Active" state

The jQuery Mobile framework uses a swatch called "active" (bright blue in the default theme) to consistently indicate the selected state, regardless of the individual swatch of the given widget. We apply this in navigation and form controls whenever there is a need to indicate what is currently selected. Because this theme swatch is designed for clear, consistent user feedback, it cannot be overridden via the markup; it is set once in the theme and applied by the framework whenever a selected or active state is needed. The styling for this state is in the theme stylesheet under the ui-btn-active style rules.

Active is used for the on state of these toggles:

Icons

There is a core set of standard icons included in the framework that can be assigned to any button. To minimize the download size of the core icons, jQuery Mobile only includes these icons in white and automatically adds a semi-transparent black circle behind the icon to make sure it has good contrast on all background colors.

Theme classes

Assigning color swatches through the data-theme attribute is one way to leverage the theme system, but it's also possible to apply any of the theme swatches directly to your markup through classes to apply the colors, textures and font formatting of your theme to any markup. This is especially useful when creating your own custom layout elements or UI widgets. Here are a few common theme classes, but many more are available in the theme stylesheet:

ui-bar-(a-z)
Applies the toolbar theme styles for the selected swatch letter. Commonly used in conjunction with ui-bar structural class to add the standard bar padding styles.
ui-body-(a-z)
Applies the content body theme styles for the selected swatch letter. Commonly used in conjunction with ui-body structural class to add the standard content block padding styles.
ui-btn-up-(a-z)
Applies the button/clickable element theme styles for the selected swatch letter. Commonly used in with the ui-btn-hover-(a-z) and ui-btn-down-(a-z) interaction class states to provide visual feedback and ui-btn-active to indicate the selected or "on" state.
ui-corner-all
Applies the theme's global border-radius for rounded corners and is used for container or grouped items in the framework (inset lists, radiobutton sets). There are additional classes for all the possible combinations of rounded corners, for example: ui-corner-tl (top left only), -top (both top corners), -left (both left corners), etc. A second full set of corner classes is provided for buttons so these can have a different corner radius. These use classes with a similar naming convention, but with "btn-corner" instead of "corner", like this: .ui-btn-corner-all.
ui-shadow
Applies the theme's global drop shadow to any element using CSS box-shadow property.
ui-disabled
Applies the disabled look and feel which essentially reduces the opacity of any element with this class to 30%, hides the cursor, and sets pointer-events: none; which prevents any interaction in many modern browsers.

Overriding themes

The themes are meant as a solid starting point, but are meant to be customized. Since everything is controlled by CSS, it's easy to use a web inspector tool to identify the style properties you want to modify. The set of of theme classes (global) and semantic structural classes (widget-specific) added to elements provide a rich set of possible selectors to target style overrides against. We recommend adding an external stylesheet to the head, placed after the structure and theme stylesheet references, that contain all your style overrides. This allows you to easily update to newer versions of the library because overrides are kept separate from the library code.

Learn more about theming individual components:

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\api-buttons.html jQuery Mobile Docs - Buttons

Button API

Home Search

Dependencies

To be documented

Options

To be documented

Methods

To be documented

Known Issues

To be documented

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-events.html jQuery Mobile Docs - Button events

Button basics

Home Search

Button basics

Bind events directly to the a, input, or button element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

 
$( ".myButton" ).bind( "click", function(event, ui) {
  ...
});

The form button plugin has the following custom events:

create triggered when a form button is created

$('[type="submit"]').button({
   create: function(event, ui) { ... }
});		
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-grouped.html jQuery Mobile Docs - Grouped Buttons

Grouped

Home Search

Grouped buttons

Occasionally, you may want to visually group a set of buttons together to form a single block that looks contained like a navigation component. To get this effect, wrap a set of buttons in a container with the data-role="controlgroup" attribute — the framework will create a vertical button group, remove all margins and drop shadows between the buttons, and only round the first and last buttons of the set to create the effect that they are grouped together.


<div data-role="controlgroup">
<a href="index.html" data-role="button">Yes</a>
<a href="index.html" data-role="button">No</a>
<a href="index.html" data-role="button">Maybe</a>
</div>

By default, grouped buttons are presented as a vertical list:

Yes No Maybe

By adding the data-type="horizontal" attribute to the controlgroup container, you can swap to a horizontal-style group that floats the buttons side-by-side and sets the width to only be large enough to fit the content. (Be aware that these will wrap to multiple lines if the number of buttons or the overall text length is too wide for the screen.)

Horizontal grouped buttons:

Yes No Maybe

Mini horizontal grouped buttons by adding data-mini="true" to the controlgroup:

Yes No Maybe

Horizontal grouped buttons with icons:

Add Delete

Mini horizontal grouped buttons with icons by adding data-mini="true" to the controlgroup::

Add Delete

Horizontal grouped buttons, icon only:

Up Down Delete
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-icons.html jQuery Mobile Docs - Button icons

Button icons

Home Search

Adding Icons to Buttons

The jQuery Mobile framework includes a selected set of icons most often needed for mobile apps. To minimize download size, jQuery Mobile includes a single white icon sprite, and automatically adds a semi-transparent black circle behind the icon to ensure that it has good contrast on any background color.

An icon can be added to a button by adding a data-icon attribute on the anchor specifying the icon to display. For example, the following markup:

<a href="index.html" data-role="button" data-icon="delete">Delete</a>

Creates this button with an icon:

Delete

A more compact button with the data-mini="true" attribute added to the button:

Delete

Icon set

The following data-icon attributes can be referenced to create the icons shown below:

Left arrow - data-icon="arrow-l"

My button

Right arrow - data-icon="arrow-r"

My button

Up arrow - data-icon="arrow-u"

My button

Down arrow - data-icon="arrow-d"

My button

Delete - data-icon="delete"

My button

Plus - data-icon="plus"

My button

Minus - data-icon="minus"

My button

Check - data-icon="check"

My button

Gear - data-icon="gear"

My button

Refresh - data-icon="refresh"

My button

Forward - data-icon="forward"

My button

Back - data-icon="back"

My button

Grid - data-icon="grid"

My button

Star - data-icon="star"

My button

Alert - data-icon="alert"

My button

Info - data-icon="info"

My button

Home - data-icon="home"

My button

Search - data-icon="search"

My button

Icon positioning

By default, all icons in buttons are placed to the left of the button text.

Delete

This default may be overridden using the data-iconpos attribute to set the icon to the right, above (top) or below (bottom) the text. For example, the markup:

<a href="index.html" data-role="button" data-icon="delete" data-iconpos="right">Delete</a>

Creates this button with right-aligned icon:

Delete

Icons can also be positioned above the text by specifying data-iconpos="top"

Delete

Or icons can also be positioned below the text by specifying data-iconpos="bottom"

Delete

You can also create an icon-only button, by setting the data-iconpos attribute to notext. The button plugin will hide the text on-screen, but add it as a title attribute on the link to provide context for screen readers and devices that support tooltips. For example, replacing data-iconpos="right" on the previous example with data-iconpos="notext":

<a href="index.html" data-role="button" data-icon="delete" data-iconpos="notext">Delete</a>

Creates this icon-only button:

Delete

Mini & Inline

The mini and inline attributes can be added to produce more compact buttons:

Delete Delete Delete Delete Delete

Custom Icons

To use custom icons, specify a data-icon value that has a unique name like myapp-email and the button plugin will generate a class by prefixing ui-icon- to the data-icon value and apply it to the button: ui-icon-myapp-email.

You can then write a CSS rule in your stylesheet that targets the ui-icon-myapp-email class to specify the icon background source. To maintain visual consistency with the rest of the icons, create a white icon 18x18 pixels saved as a PNG-8 with alpha transparency.

In this example, we're just pointing to a standalone icon image, but you could just as easily use an icon sprite and specify the positioning instead, just like the icon sprite we use in the framework.

.ui-icon-myapp-email {
	background-image: url("app-icon-email.png");
}

This will create the standard resolution icon, but many devices now have very high resolution displays, like the retina display on the iPhone 4. To add a HD icon, create an icon that is 36x36 pixels (exactly double the 18 pixel size), and add second a rule that uses the -webkit-min-device-pixel-ratio: 2 media query to target a rule only to high resolution displays. Specify the background image for the HD icon file and set the background size to 18x18 pixels which will fit the 36 pixel icon into the same 18 pixel space. The media query block can wrap multiple icon rules:


@media only screen and (-webkit-min-device-pixel-ratio: 2) {
	.ui-icon-myapp-email {
		background-image: url("app-icon-email-highres.png");
		background-size: 18px 18px;
	}
	...more HD icon rules go here...
}

Icons and themes

The semi-transparent black circle behind the white icon ensures good contrast on any background color so it works well with the jQuery Mobile theming system. Here are examples of the same icons sitting on top of a range of different color swatches with themed buttons.

Swatch "a" themed buttons

My button My button My button My button My button My button My button My button My button
My button My button My button My button My button My button My button My button My button

Swatch "b" themed buttons

My button My button My button My button My button My button My button My button My button
My button My button My button My button My button My button My button My button My button

Swatch "c" themed buttons

My button My button My button My button My button My button My button My button My button
My button My button My button My button My button My button My button My button My button
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-inline.html jQuery Mobile Docs - Inline buttons

Inline buttons

Home Search

Inline buttons

By default, all buttons in the body content are styled as block-level element so they fill the width of the screen:

Button

However, if you want a more compact button that is only as wide as the text and icons inside, add the data-inline="true" attribute to the button:

Button

If you have multiple buttons that should sit side-by-side on the same line, add the data-inline="true" attribute to each button. This will style the buttons to be the width of their content and float the buttons so they sit on the same line.


<a href="index.html" data-role="button" data-inline="true">Cancel</a>
<a href="index.html" data-role="button" data-inline="true" data-theme="b">Save</a>

The result is this:

Cancel Save

Adding the data-mini="true" to the inline buttons creates a more compact version:

Cancel Save

If you want buttons to sit side-by-side but stretch to fill the width of the screen, you can use the content column grids to put normal full-width buttons into 2- or 3-columns.

Icon example

When an icon is added to an inline button, the button will grow wider to accommodate the icon:

Cancel Save

A mini version of the same:

Cancel Save

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-methods.html jQuery Mobile Docs - Button methods

Button basics

Home Search

Button basics

The following methods apply only to form buttons. Link-based buttons do not have any associated methods.

enable enable a disabled form button

$('[type="submit"]').button('enable');			
				
disable disable a form button

$('[type="submit"]').button('disable');			
				
refresh update the form button

If you manipulate a form button via JavaScript, you must call the refresh method on it to update the visual styling.

		
$('[type="submit"]').button('refresh');
				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-options.html jQuery Mobile Docs - Button options

Button basics

Home Search

Button basics

The following options apply to all buttons:

corners boolean

default: true

Applies the theme button border-radius if set to true. This option is also exposed as a data attribute: data-corners="false"

$('a').buttonMarkup({ corners: "false" });
No rounded corners
icon string

default: null

Applies an icon from the icon set. This option is also exposed as a data attribute: data-icon="star"

$('a').buttonMarkup({ icon: "star" });
Star icon
iconpos string

default: "left"

Positions the icon in the button. Possible values: left, right, top, bottom, none, notext. The notext value will display an icon-only button with no text feedback. This option is also exposed as a data attribute: data-iconpos="left"

$('a').buttonMarkup({ iconpos: "right" });
Star icon
iconshadow boolean

default: true

Applies the theme shadow to the button's icon if set to true. This option is also exposed as a data attribute: data-iconshadow="false"

$('a').buttonMarkup({ iconshadow: "false" });
No icon shadow
inline boolean

default: null (false)

If set to true, this will make the button act like an inline button so the width is determined by the button's text. By default, this is null (false) so the button is full width, regardless of the feedback content. Possible values: true, false. This option is also exposed as a data attribute: data-inline="true"

$('a').buttonMarkup({ inline: "true" });
Inline
mini boolean

default: null (false)

If set to true, this will display a more compact version of the button that uses less vertical height. Possible values: true, false. This option is also exposed as a data attribute: data-mini="true"

$('a').buttonMarkup({ mini: "true" });
Inline
shadow boolean

default: true

Applies the drop shadow style to the button if set to true. This option is also exposed as a data attribute: data-shadow="false"

$('a').buttonMarkup({ shadow: "false" });
No button shadow
theme string

default: null, inherited from parent

Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

$('a').buttonMarkup({ theme: "a" });
Theme A

The following option applies only to form buttons, which are automatically initialized by the framework:

initSelector CSS selector string

default: "button, [type='button'], [type='submit'], [type='reset']"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as form buttons. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
   $.mobile.button.prototype.options.initSelector = ".myButtons";
});
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-themes.html jQuery Mobile Docs - Theming buttons

Theming buttons

Home Search

Theming buttons

jQuery Mobile has a rich theming system that gives you full control of how buttons are styled. When a link is added to a container, it is automatically assigned a theme swatch letter that matches its parent bar or content box to visually integrate the button into the parent container, like a chameleon. So a button placed inside a content container with a theme of "a" (black in the default theme) will be automatically assigned the button theme of "a" (charcoal in the default theme). Here are examples of the button theme pairings in the default theme. All buttons have the same HTML markup:

Swatch "a"

Button

Swatch "b"

Button

Swatch "c"

Button

Swatch "d"

Button

Swatch "e"

Button

Assigning theme swatches

Buttons can be manually assigned any of the button color swatches from the theme to add visual contrast with the container they sit inside by adding the data-theme attribute on the button markup and specifying a swatch letter.

			
<a href="index.html" data-role="button" data-theme="a">Swatch a</a>			

Here are 5 buttons with icons that have a different swatch letter assigned via the data-theme attribute.

Swatch a Swatch b Swatch c Swatch d Swatch e

Theme variations

Swatch "a" on container with themed buttons inside

Swatch "b" on container with themed buttons inside

Swatch "c" on container with themed buttons inside

Swatch "d" on container with themed buttons inside

Swatch "e" on container with themed buttons inside

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\buttons-types.html jQuery Mobile Docs - Button types

Button basics

Home Search

Button basics

Buttons are coded with standard HTML anchor and input elements, then enhanced by jQuery Mobile to make them more attractive and useable on a mobile device. Use anchor links (a elements) to mark up navigation buttons, and input or button elements for form submission.

View the data- attribute reference to see all the possible attributes for buttons including adding icons or displaying them inline or grouped.

Styling links as buttons

In the main content block of a page, you can style any anchor link as a button by adding the data-role="button" attribute. The framework will enhance the link with markup and classes to style the link as a button. For example, this markup:

<a href="index.html" data-role="button">Link button</a>

Produces this link-based button:

Link button

Note: Links styled like buttons have all the same visual options as true form-based buttons below, but there are a few important differences. Link-based buttons aren't part of the button plugin and only just use the underlying buttonMarkup plugin to generate the button styles so the form button methods (enable, disable, refresh) aren't supported. If you need to disable a link-based button (or any element), it's possible to apply the disabled class ui-disabled yourself with JavaScript to achieve the same effect.

Mini size

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the button to create a mini version.

	
<a href="index.html" data-role="button" data-mini="true">Link button</a>

This will produce a search input that a not as tall as the standard version and has a smaller text size.

Link button

Form buttons

For ease of styling, the framework automatically converts any button or input element with a type of submit, reset, or button into a custom styled button — there is no need to add the data-role="button" attribute. However, if needed, you can directly call the button plugin on any selector, just like any jQuery plugin:

$('[type="submit"]').button();

To preserve events bound to the original button or input, the framework hides the original element by making it transparent and positioning it over the new button markup. When a user clicks on the custom-styled button, they're actually clicking on the original element. To prevent a form button from being converted into an enhanced button, add the data-role="none" attribute and the native control will be rendered.

Button based button:

	
<button>Button element</button>

Input type="button" based button:

	
<input type="button" value="Button" />

Input type="submit" based button:


<input type="submit" value="Submit Button" />

Input type="reset" based button:


<input type="reset" value="Reset Button" />
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\buttons\index.html jQuery Mobile Docs - Buttons

Buttons

Home Search

Buttons are core widgets in jQuery Mobile, and are used within a wide range of other plugins.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\dialogTransition.html jQuery Mobile Docs - Configuration

Config applied

Home Search

defaultDialogTransition is now "flip"

To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

Browse docs Or open a basic dialog
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\index.html jQuery Mobile Docs - Configuration

Pages

Home Search

Global config tests

The following links will cause a full page refresh so that the global options configuration can take effect. Each link below will tweak a different option for quick testing.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\iOSFullscreen.html jQuery Mobile Docs - Configuration

jQuery Mobile

Home Search

Fullscreen docs in iOS

First, hit Add to Home Screen to create a new shortcut icon on the home screen. Next, open the new shortcut and hit the button below to browse the docs as a fullscreen web app.

Browse docs
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\jq17b1.html jQuery Mobile Docs - Configuration

jQuery version

Home Search

jQuery core version 1.7 Beta 1

To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

Browse docs
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\loadingMessage.html jQuery Mobile Docs - Configuration

Config applied

Home Search

loadingMessage is now disabled

To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

Browse docs
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\loadingMessageTextVisible.html jQuery Mobile Docs - Configuration

Config applied

Home Search

loadingMessage text is now visible

To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

Browse docs

To display the loading message on demand:

$.mobile.showPageLoadingMsg();

Click the buttons below to show and hide the loading message with the default options.

Theming the loading message

To display the loading message with a different theme and message:

$.mobile.showPageLoadingMsg("a", "Loading theme a...");

The theme and message can be changed on the fly by calling the method again. Click the buttons below to see the loading message with the indicated theme.

Text only messages

To display the loading message with no spinner:

$.mobile.showPageLoadingMsg("a", "No spinner", true);

Click the button below to see the loading message with no spinner.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\minScrollBack.html jQuery Mobile Docs - Configuration

Config applied

Home Search

minScrollBack is now set to 999 (disabled)

To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

Browse docs
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\pageLoadErrorMessage.html jQuery Mobile Docs - Configuration

Config applied

Home Search

pageLoadErrorMessage is now "Yikes, we broke the internet!"

To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

Browse docs Or try this broken link
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\pageTransition.html jQuery Mobile Docs - Configuration

Config applied

Home Search

defaultPageTransition is now "flow"

To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

Browse docs
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\pushState.html jQuery Mobile Docs - Configuration

Config applied

Home Search

pushStateEnabled is now disabled

To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

Browse docs
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\config\touchOverflow.html jQuery Mobile Docs - Configuration

Config applied

Home Search

touchOverflowEnabled is now active

The toolbar on this page should now be fixed, like a native toolbar. To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

Browse docs touchOverflow docs

Some good pages to test out:

Fixed toolbars Fullscreen toolbars Fixed persistent footer Dialogs & transitions
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\api-content.html jQuery Mobile Docs - Content formatting

Content formatting API

Dependencies

To be documented

Options

To be documented

Methods

To be documented

Known Issues

To be documented

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-events.html jQuery Mobile Docs - Collapsible Content

Collapsible

Home Search

Collapsible content

Bind events directly to the container, typically a div element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:


$( ".selector" ).bind( "collapse", function(event, ui) {
  ...
});

The collapsible plugin has the following custom events:

create triggered when a collapsible is created

$( ".selector" ).collapsible({
   create: function(event, ui) { ... }
});
			
collapse triggered when a collapsible is collapsed

$( ".selector" ).collapsible({
   collapse: function(event, ui) { ... }
});
			
expand triggered when a collapsible is expanded

$( ".selector" ).collapsible({
   expand: function(event, ui) { ... }
});
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-methods.html jQuery Mobile Docs - Collapsible Content

Collapsible

Home Search

Collapsible content

The collapsible plugin has no public methods.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-options.html jQuery Mobile Docs - Collapsible Content

Collapsible

Home Search

Collapsible content

The collapsible plugin has the following options:

collapsed boolean

default: true

When false, the container is initially expanded with a minus icon in the header. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsible.prototype.options.collapsed = false;
});

This option is also exposed as a data attribute: data-collapsed="false".

collapseCueText string

default: " click to collapse contents"

This text is used to provide audible feedback for users with screen reader software. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsible.prototype.options.collapseCueText = " collapse with a click";
});
contentTheme string

default: null, inherited from parent

Sets the color scheme (swatch) for the collapsible content block. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsible.prototype.options.contentTheme = "a";
});

This option is also exposed as a data attribute: data-content-theme="a".

expandCueText string

default: " click to expand contents"

This text is used to provide audible feedback for users with screen reader software. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsible.prototype.options.expandCueText = " expand with a click";
});
heading string

default: "h1,h2,h3,h4,h5,h6,legend"

Within the collapsible container, the first immediate child element that matches this selector will be used as the header for the collapsible. To change the selector, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsible.prototype.options.heading = ".mycollapsibleheading";
});
iconpos string

default: "left"

Positions the icon in the collapsible header. Possible values: left, right, top, bottom, none, notext.

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsible.prototype.options.iconpos = "right";
});

This option is also exposed as a data attribute: data-iconpos="right".

initSelector CSS selector string

default: ":jqmData(role='collapsible')"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as collapsibles. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsible.prototype.options.initSelector = ".mycollapsible";
});
mini boolean

default: false

Sets the size of the element to a more compact, mini version. If the value is false for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsible.prototype.options.mini = true;
});

This option is also exposed as a data attribute: data-mini="true".

theme string

default: null, inherited from parent

Sets the color scheme (swatch) for the collapsible. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsible.prototype.options.theme = "a";
});

This option is also exposed as a data attribute: data-theme="a".

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-set-events.html jQuery Mobile Docs - Collapsible Content

Collapsible set

Home Search

Collapsible sets

Bind events directly to the set container, typically a div element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:


$( ".selector" ).bind( "create", function(event, ui) {
  ...
});

The collapsible set plugin has the following custom event:

create triggered when a collapsible set is created

$( ".selector" ).collapsibleset({
   create: function(event, ui) { ... }
});
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-set-methods.html jQuery Mobile Docs - Collapsible Sets

Collapsible set

Home Search

Collapsible sets

The collapsible set plugin has the following method:

refresh update the collapsible set

If you manipulate a collapsible set via JavaScript (e.g. add new collapsible containers), you must call the refresh method on it to update the visual styling.


$('.selector').collapsibleset('refresh');
				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-set-options.html jQuery Mobile Docs - Collapsible Sets

Collapsible set

Home Search

Collapsible sets

The collapsible plugin has the following options:

iconpos string

default: "left"

Positions the icons in the collapsible headers. Possible values: left, right, top, bottom, none, notext.

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsibleset.prototype.options.iconpos = "right";
});

This option is also exposed as a data attribute: data-iconpos="right".

initSelector CSS selector string

default: ":jqmData(role='collapsible-set')"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as collapsible sets. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsibleset.prototype.options.initSelector = ".mycollapsibleset";
});
mini boolean

default: false

Sets the size of the element to a more compact, mini version. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsibleset.prototype.options.mini = true;
});

This option is also exposed as a data attribute: data-mini="true".

theme string

default: null, inherited from parent

Sets the color scheme (swatch) for the collapsible set. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.collapsibleset.prototype.options.theme = "a";
});

This option is also exposed as a data attribute: data-theme="a".

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible-set.html jQuery Mobile Docs - Collapsible Content

Collapsible set

Home Search

Collapsible set (accordion)

Collapsible sets start with the exact same markup as individual collapsibles. By adding a parent wrapper with a data-role="collapsible-set" attribute around a number of collapsibles, the framework will style these to looks like a visually grouped widget and make it behave like an accordion so only one section can be open at a time. View the data- attribute reference to see all the possible attributes you can add to collapsible sets.

By default, all the sections will be collapsed. To set a section to be open when the page loads, add the data-collapsed="false" attribute to the heading of the section you want expanded.

		
<div data-role="collapsible-set">

	<div data-role="collapsible" data-collapsed="false">
	<h3>Section 1</h3>
	<p>I'm the collapsible set content for section 1.</p>
	</div>
	
	<div data-role="collapsible">
	<h3>Section 2</h3>
	<p>I'm the collapsible set content for section 2.</p>
	</div>
	
</div>
	

Here is an example of a collapsible set with 5 sections.

Section 1

I'm the collapsible content in a set so this feels like an accordion. I'm open by default because I have the data-collapsed="false" attribute.

Section 2

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Section 3

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Section 4

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Section 5

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Mini collapsible sets

For a more compact version that is useful in tight spaces, add the data-mini="true" attribute to the element to create a mini version.

Section 1

Collapsible content

Section 2

Collapsible content

Section 3

Collapsible content

Icon positioning

Collapsible headings’ default icon positioning can be overridden by using the data-iconpos attribute, either at the collapsible-set level or on an individual collapsible basis.

Section 1

Inherits icon positioning from data-iconpos="right" attribute on parent.

Section 2

data-iconpos="left"

Section 3

data-iconpos="bottom"

Section 4

data-iconpos="top"

Theming collapsible content

The standard data-theme attribute can be used to set the color of each collapsible in a set. To provide a clearer visual grouping of the content with the headers, add the data-content-theme attribute with a swatch letter. This adds a themed background color and border to the content block. For consistent theming, add these attributes to the parent collapsible set.

		
<div data-role="collapsible-set" data-theme="c" data-content-theme="d">

Section 1

Collapsible content

Section 2

Collapsible content

Section 3

Collapsible content

Theming individual sections

To have individual sections in a group styled differently, add data-theme and data-content-theme attributes to specific collapsibles.

Section header, swatch B

Collapsible content, swatch "b"

Section header, swatch A

Collapsible content, swatch "a">

Section header, swatch E

Collapsible content, swatch "d"

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-collapsible.html jQuery Mobile Docs - Collapsible Content

Collapsible

Home Search

Collapsible content

To create a collapsible block of content, create a container and add the data-role="collapsible" attribute. Using data-content-theme attribute allows you to set a theme for the content of the collapsible. View the data- attribute reference to see all the possible attributes you can add to collapsibles.

Directly inside this container, add any header element (H1-H6). The framework will style the header to look like a clickable button and add a "+" icon to the left to indicate it's expandable.

After the header, add any HTML markup you want to be collapsible. The framework will wrap this markup in a container that will be hidden/shown when the heading is clicked.

By default, the content will be collapsed.

		
<div data-role="collapsible">
   <h3>I'm a header</h3>
   <p>I'm the collapsible content. By default I'm closed, but you can click the header to open me.</p>
</div>

I'm a header

I'm the collapsible content. By default I'm closed, but you can click the header to open me.

Expanding collapsibles on load

To expand the content when the page loads, add the data-collapsed="false" attribute to the wrapper.

<div data-role="collapsible" data-collapsed="false">

This code will create a collapsible widget like this:

I'm a header

I'm the collapsible content. I'm expanded by default because I have the "collapsed" state set to false.

Mini collapsibles

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

<div data-role="collapsible" data-mini="true">

This code will create a mini collapsible widget:

I'm a mini header

I'm the collapsible content. I'm expanded by default because I have the "collapsed" state set to false.

Icon positioning

Collapsible headings’ default icon positioning can be overridden by using the data-iconpos attribute. In the below case, data-iconpos="right".

I'm a header

data-iconpos="right"

Theming collapsible content

Collapsible content is minimally styled — we add only a bit of margin between the bar and content, and the header adopts the default Theme styles of the container it sits within.

To provide a stronger visual connection between the collapsible header and content, add the data-content-theme attribute to the wrapper and specify a theme swatch letter. This will apply the swatch's border and flat background color (not the gradient) to the content block and changes the corner rounding to square off the bottom of the header and round the bottom of the content block instead to visually group these elements.

		
<div data-role="collapsible" data-content-theme="c">
   <h3>Header</h3>
   <p>I'm the collapsible content with a themed content block set to "c".</p>
</div>

Header

I'm the collapsible content with a themed content block set to "c".

Theming collapsible headers

To set the theme on a collapsible header button, add the data-theme attribute to the wrapper and specify a swatch letter. Note that you can mix and match swatch letters between the header and content with these theme attributes.

		
<div data-role="collapsible" data-theme="a" data-content-theme="a">
   <h3>Header swatch A</h3>
   <p>I'm the collapsible content with a themed content block set to "a".</p>
</div>

Header swatch A

I'm the collapsible content with a themed content block set to "a".

Header swatch B

I'm the collapsible content with a themed content block set to "d".

Nested Collapsibles

Collapsibles can be nested inside each other if needed. In this example, we're setting the content theme to provide clearer visual connection between the levels.

I'm a header

I'm the collapsible content. By default I'm open and displayed on the page, but you can click the header to hide me.

I'm a nested collapsible with a child collapsible

I'm a child collapsible.

Nested inside again.

Three levels deep now.

Section 3: Form elements

Section 4: Collapsed list

Here is an inset list:

Collapsible sets (accordions)

It's possible to combine multiple collapsibles into a grouped sets that acts like an accordion widget.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-grids.html jQuery Mobile Docs - Content Grids

Layout grids

Home Search

Using multiple column layouts isn't generally recommended on a mobile device because of the narrow screen width, but there are times where you may need to place small elements side-by-side (like buttons or navigation tabs, for example).

The jQuery Mobile framework provides a simple way to build CSS-based columns through a block style class convention called ui-grid.

There are four preset configurations layouts that can be used in any situation that requires columns:

  • two-column (using the ui-grid-a class)
  • three-column (using the ui-grid-b class)
  • four-column (using the ui-grid-c class)
  • five-column (using the ui-grid-d class)

Grids are 100% width, completely invisible (no borders or backgrounds) and don't have padding or margins, so they shouldn't interfere with the styles of elements placed inside them.

Within the grid container, child elements are assigned ui-block-a/b/c/d/e in a sequential manner which makes each "block" element float side-by-side, forming the grid. The ui-block-a class essentially clears the floats which will start a new line (see multiple row grids, below).

Two column grids

To build a two-column (50/50%) layout, start with a container with a class of ui-grid-a, and add two child containers inside it classed with ui-block-a for the first column and ui-block-b for the second:


<div class="ui-grid-a">
	<div class="ui-block-a"><strong>I'm Block A</strong> and text inside will wrap</div>
	<div class="ui-block-b"><strong>I'm Block B</strong> and text inside will wrap</div>
</div><!-- /grid-a -->

The above markup produces the following content layout:

I'm Block A and text inside will wrap.
I'm Block B and text inside will wrap.

As you see above, by default grid blocks have no visual styling; they simply present content side-by-side.

Grid classes can be applied to any container. In this next example, we add ui-grid-a to a fieldset, and apply the ui-block classes to the container of each of the two buttons inside to stretch them each to 50% of the screen width:


<fieldset class="ui-grid-a">
	<div class="ui-block-a"><button type="submit" data-theme="c">Cancel</button></div>
	<div class="ui-block-b"><button type="submit" data-theme="b">Submit</button></div>	   
</fieldset>

Please note that the framework adds left and right margin to buttons in a grid. For a single button you can use a container with class ui-grid-solo and wrap the button in a div with class ui-block-a like the example below. This way the button will get the same margin.


<div class="ui-grid-a">
	<div class="ui-block-a"><button type="button" data-theme="c">Previous</button></div>
	<div class="ui-block-b"><button type="button" data-theme="c">Next</button></div>	   
</div>
<div class="ui-grid-solo">
	<div class="ui-block-a"><button type="v" data-theme="b">More</button></div>
</div>

Theme classes (not data-theme attributes) from the theming system can be added to an element, including grids. On the blocks below, we're adding two classes: ui-bar to add the default bar padding and ui-bar-e to apply the background gradient and font styling for the "e" toolbar theme swatch. For illustration purposes, an inline style="height:120px" attribute is also added to each grid to set each to a standard height.

Block A
Block B

Three-column grids

The other grid layout configuration uses class=ui-grid-b on the parent, and 3 child container elements, each with its respective ui-block-a/b/c class, to create a three-column layout (33/33/33%). Note: These blocks are also styled with theme classes so the grid layout is clearly visible.


<div class="ui-grid-b">
	<div class="ui-block-a">Block A</div>
	<div class="ui-block-b">Block B</div>
	<div class="ui-block-c">Block C</div>
</div><!-- /grid-b -->

This will produce a 33/33/33% grid for our content.

Block A
Block B
Block C

And an example of a 3 column grid with buttons inside:

Four-column grids

A four-column, 25/25/25/25% grid is created by specifying class=ui-grid-c on the parent and adding a fourth block. Note: These blocks are also styled with theme classes so the grid layout is clearly visible.

A
B
C
D

Five-column grids

A five-column, 20/20/20/20/20% grid is created by specifying class=ui-grid-d on the parent and adding a fifth block. Note: These blocks are also styled with theme classes so the grid layout is clearly visible.

A
B
C
D
E

Multiple row grids

Grids are designed to wrap to multiple rows of items. For example, if you specify a 3-column grid (ui-grid-b) on a container that has nine child blocks, it will wrap to 3 rows of 3 items each. There is a CSS rule to clear the floats and start a new line when the class=ui-block-a is seen so make sure to assign block classes in a repeating sequence (a, b, c, a, b, c, etc.) that maps to the grid type:

A
B
C
A
B
C
A
B
C

Grids in toolbars

Grids are helpful for creating layouts within a toolbar. Here's a footer with a 4 column grid.

Settings

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-html.html jQuery Mobile Docs - HTML formatting

HTML Formatting

Home Search

The default approach to styling content in jQuery Mobile is simple: Use a light hand. Our goal is to let the browser's native rendering take precedence; we add a bit of padding for more comfortable readability, and use the theming system to apply the font family and colors.

Taking a light hand with content styling gives designers and developers a clean slate to work with, instead of fighting against a lot of complex style overhead.

Default HTML markup styling

By default, jQuery Mobile themes use standard HTML styles and sizes for standard markup elements like headers, paragraph content, block quotes, anchor links, standard ordered, unordered and definition lists, and tables — as shown in the examples below:


H1 Heading

H2 Heading

H3 Heading

H4 Heading

H5 Heading
H6 Heading

This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

How about some blockquote action with a cite

This is another paragraph of text so you can see how HTML markup works in content. This is another paragraph of text so you can see how HTML markup works in content. This is another paragraph of text so you can see how HTML markup works in content.

We add a few styles to tables and fieldsets to make them more legible, which are easily overridden with customs styles.

  • Unordered list item 1
  • Unordered list item 1
  • Unordered list item 1
  1. Ordered list item 1
  2. Ordered list item 1
  3. Ordered list item 1
Definition term
I'm the definition text
Definition term
I'm the definition text
Travel Itinerary
Flight: From: To:
Total: 3 flights
JetBlue 983 Boston (BOS) New York (JFK)
JetBlue 354 San Francisco (SFO) Los Angeles (LAX)
JetBlue 465 New York (JFK) Portland (PDX)
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\content-themes.html jQuery Mobile Docs - Content Themes

Theming content

Home Search

Theming the content area

The main content area of a page (container with the data-role="content" attribute) should be themed by adding the data-theme attribute to the data-role="page" container to ensure that the background colors are applied to the full page, regardless of the content length. (If you add the data-theme attribute to the content container, the background color will stop after the content. So there may be a gap in color between the content and fixed footer.)

Additionally, the content area of a collapsible can be themed to match the theme of the collapsible header using the data-content-theme attribute.

<div data-role="page" data-theme="a" data-content-theme="a">

Theming collapsible blocks

To set the color of the collapsible header, add the data-theme attribute to the collapsible container. The icon and body are not currently themable through data attributes, but can be styled directly with custom css.

<div data-role="collapsible" data-collapsed="true" data-theme="a">

Themed examples

Swatch "a" on content & collapsible

H1 Heading

This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

I'm a themed collapsible

I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

I'm a themed collapsible with a themed content

I have data-content-theme attribute set manually on my container to set the color to match the content block I'm in.

Swatch "b" on content & collapsible

H1 Heading

This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

I'm a themed collapsible

I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

I'm a themed collapsible with a themed content

I have data-content-theme attribute set manually on my container to set the color to match the content block I'm in.

Swatch "c" on content & collapsible

H1 Heading

This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

I'm a themed collapsible

I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

I'm a themed collapsible with a themed content

I have data-content-theme attribute set manually on my container to set the color to match the content block I'm in.

Swatch "d" on content & collapsible

H1 Heading

This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

I'm a themed collapsible

I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

I'm a themed collapsible with a themed content

I have data-content-theme attribute set manually on my container to set the color to match the content block I'm in.

Swatch "e" on content & collapsible

H1 Heading

This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

I'm a themed collapsible

I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

I'm a themed collapsible with a themed content

I have data-content-theme attribute set manually on my container to set the color to match the content block I'm in.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\content\index.html jQuery Mobile Docs - Content formatting

Content formatting

Home Search

The content of pages in jQuery Mobile is completely open-ended, but the jQuery Mobile framework provides a number of helpful tools and widgets — such as collapsible panels and multiple-column grid layouts — to make it easy to format your content for mobile devices.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\docs-forms.html jQuery Mobile Docs - Forms

Forms

Home Search

jQuery Mobile provides a complete set of finger-friendly form elements that are based on native HTML form elements.

Form structure

All forms should be wrapped in a form tag that has an action and method that will handle the form data processing on the server.

<form action="form.php" method="post"> ... </form>

Markup conventions

When constructing forms to be used in jQuery Mobile, most of the standard guidelines used to create forms that submit via ordinary HTTP POST or GET still apply. Additionally, the id attributes of form controls need to be not only unique on a given page, but also unique across the pages in a site. This is because jQuery Mobile's single-page navigation model allows many different "pages" to be present in the DOM at the same time. You must be careful to use unique id attributes so there will be only one of each in the DOM. Be sure to pair them properly with label elements via the for attribute.

Mini sized elements

For a more compact version of all form elements and buttons, add the data-mini="true" attribute to the element to create a mini version. This is useful in toolbars and tight spaces but is still finger-friendly. It's possible to add this attribute to a fieldcontainer to set this on a number of elements at once.


<label for="basic">Text Input:</label>
<input type="text" name="name" id="basic" data-mini="true" />
	

This will produce an input that is not as tall as the standard version and has a smaller text size.

Hiding labels accessibly

For the sake of accessibility, jQuery Mobile requires that all form elements be paired with a meaningful label. To hide labels in a way that leaves them visible to assistive technologies—for example, when letting an element’s placeholder attribute serve as a label—apply the helper class ui-hidden-accessible to the label itself:

<label for="username" class="ui-hidden-accessible">Username:</label>
<input type="text" name="username" id="username" value="" placeholder="Username"/>

To hide labels within a field container and adjust the layout accordingly, add the class ui-hide-label to the field container as in the following:

<div data-role="fieldcontain" class="ui-hide-label">
	<label for="username">Username:</label>
	<input type="text" name="username" id="username" value="" placeholder="Username"/>
</div>

Both of the above examples will render as:

While the label will no longer be visible, it will be available to assisitive technologies such as screen readers.

Disabling form elements

All jQuery Mobile widgets can be disabled in the markup by adding the standard disabled attribute to the element, just like you would with native controls. Each form widget also has standard disable and enable methods that are documented with each form widget. Here are a few examples of disabled widgets:

Gender:

Note that you can disable buttons created from button or input-based markup, but not links with a role of button. Links don't have a parallel disabled feature in HTML, but if you need to disable a link-based button (or any element), it's possible to apply the disabled class ui-disabled yourself with JavaScript to achieve the same effect.

Field containers

To improve the styling of labels and form elements on wider screens, wrap a div or fieldset with the data-role="fieldcontain" attribute around each label/form element. This framework aligns the input and associated label side-by-side, and breaks to stacked block-level elements below ~480px. The framework will also add a thin bottom border to act as a field separator.

Forms in toolbars

While all form elements are now tested to work correctly within static toolbars as of jQuery Mobile 1.1, we recommend extensive testing when using form elements within fixed toolbars or within any position: fixed elements. This can potentially trigger a number of unpredictable issues in various mobile browsers, Android 2.2/2.3 in particular (detailed in Known issues in Android 2.2/2.3).

For example:


<div data-role="fieldcontain">
	<label for="name">Text Input:</label>
	<input type="text" name="name" id="name" value="" />
</div>

Will render as:

For additional examples, see the form elements gallery

Auto-initialization of form elements

By default, jQuery Mobile will automatically enhance certain native form controls into rich touch-friendly components. This is handled internally by finding form elements by tag name and running a plugin method on them. For instance, a select element will be found and initialized with the "selectmenu" plugin, while an input element with a type="checkbox" will be enhanced with the "checkboxradio" plugin. Once initialized, you can address these enhanced components programmatically through their jQuery UI widget API methods. See options, methods, and events listed on each form plugin's documentation page for details.

Initializing groups of dynamically-injected form elements

If you should generate new markup client-side or load in content via AJAX and inject it into a page, you can trigger the create event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (see below).

For example, if a block of HTML markup (say a login form) was loaded in through Ajax, trigger the create event to automatically transform all the widgets it contains (inputs and buttons in this case) into the enhanced versions. The code for this scenario would be:

$( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" );

Refreshing form elements

In jQuery Mobile, some enhanced form controls are simply styled (inputs), but others are custom controls (selects, sliders) built from, and kept in sync with, the native control. To programmatically update a form control with JavaScript, first manipulate the native control, then use the refresh method to tell the enhanced control to update itself to match the new state. Here are some examples of how to update common form controls, then call the refresh method:

Checkboxes:

$("input[type='checkbox']").prop("checked",true).checkboxradio("refresh");

Radios:

$("input[type='radio']").prop("checked",true).checkboxradio("refresh");

Selects:

var myselect = $("#selectfoo");
myselect[0].selectedIndex = 3;
myselect.selectmenu("refresh");

Sliders:

$("input[type='range']").val(60).slider("refresh");

Flip switches (they use slider):

var myswitch = $("#selectbar");
myswitch[0].selectedIndex = 1;
myswitch.slider("refresh");

Preventing auto-initialization of form elements

If you'd prefer that a particular form control be left untouched by jQuery Mobile, simply give that element the attribute data-role="none". For example:


<label for="foo">
<select name="foo" id="foo" data-role="none">
	<option value="a">A</option>
	<option value="b">B</option>
	<option value="c">C</option>
</select>

If you'd like to prevent auto-initialization without adding attributes to your markup, you can customize the selector that is used for preventing auto-initialization by setting the page plugin's keepNative option (which defaults to [data-role="none"]). Be sure to configure this option inside an event handler bound to the mobileinit event, so that it applies to the first page as well as subsequent pages that are loaded.


$(document).bind('mobileinit',function(){
	$.mobile.page.prototype.options.keepNative = "select, input.foo, textarea.bar";
});
		

Alternately you can use the data-enhance="false" data attribute on a parent element with $.mobile.ignoreContentEnabled set to true. Beware though, this will incur a performance penalty for each and every element in the page that would otherwise be enhanced as jQuery Mobile must traverse the set of parents to look for those elements.

One special case is that of selects. The above sample will prevent any and all augmentation from taking place on select elements in the page if select is included. If you wish to retain the native performance and appearance of the menu itself and benefit from the visual augmentation of the select button by jQuery Mobile, you can set $.mobile.selectmenu.prototype.options.nativeMenu to true in a mobileinit callback as a global setting or use data-native-menu="true" on a case by case basis.

File Inputs

Using a multipart form with a file input is not supported by ajax. In this case you should decorate the parent form with data-ajax="false" to ensure the form is submitted properly to the server.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-all-compare.html jQuery Mobile Docs - Form element size comparison

Form sizes

Home Search

Form size comparison

All form controls accept a data-mini="true" attribute that renders a smaller version of the enhanced element. In the case of grouped buttons, the data-mini="true" attribute can be added to the containing controlgroup.

Search

Text

Textarea

Switch

Slider

Select

Checkbox

Checkbox

Radio buttons

Radio toggle

Radio toggle

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-all-mini.html jQuery Mobile Docs - Gallery of Form Controls

Mini forms

Home Search

Mini form elements

All form controls accept a data-mini="true" attribute that renders a smaller version of the standard-sized form elements. In the case of grouped buttons, the data-mini="true" attribute can be added to the containing controlgroup. Compare mini and normal form elements side-by-side.

Choose as many snacks as you'd like:
Font styling:
Choose a pet:
Layout view:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-all-native.html jQuery Mobile Docs - Native Form Controls

Forms

Home Search

Native form elements & buttons

Although the framework automatically enhances form elements and buttons into touch input optimized controls to streamline development, it's easy to tell jQuery Mobile to leave these elements alone so the standard, native control can be used instead.

Adding the data-role="none" attribute to any form or button element tells the framework to not apply any enhanced styles or scripting. The examples below all have this attribute in place to demonstrate the effect. You may need to write custom styles to lay out your form controls because we try to leave all the default styling intact.

As of Version 1.1 adding the data-enhance="false" attribute to any container will tell the framework, not to enhance any element inside. To activate this functionality, $.mobile.ignoreContentEnabled must be set to true. View Configuring Defaults before using it.

Choose as many snacks as you'd like:
Font styling:
Choose a pet:
Layout view:

Button based button:

Input type="button" based button:

Input type="submit" based button:

Input type="reset" based button:

Input type="image" based button:

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-all.html jQuery Mobile Docs - Gallery of Form Controls

Forms

Home Search

Form elements

This page contains various progressive-enhancement driven form controls. Native elements are sometimes hidden from view, but their values are maintained so the form can be submitted normally. Browsers that don't support the custom controls will still deliver a usable experience because all are based on native form elements.

There is a complete set of mini-sized form elements which are useful for toolbars or tighter spaces. Compare mini and normal form elements side-by-side.

Choose as many snacks as you'd like:
Font styling:
Choose a pet:
Layout view:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-sample.html jQuery Mobile Docs - Sample Form Submit

Forms

Home Search

Ajax form submission

In jQuery Mobile, form submissions are automatically handled using Ajax whenever possible, creating a smooth transition between the form and the result page. To ensure your form submits as intended, be sure to specify action and method properties on your form element. When unspecified, the method will default to get, and the action will default to the current page's relative path (found via $.mobile.path.get())

Forms also accept attributes for transitions just like anchors, such as data-transition="pop" and data-direction="reverse". To submit a form without Ajax, you can either disable Ajax form handling globally, or per form via the data-ajax="false" attribute. The target attribute (as in target="_blank") is respected on forms as well, and will default to the browser's handling of that target when the form submits. Note that unlike anchors, the rel attribute is not allowed on forms.

Default Ajax form example

This demonstrates automated ajax handling of form submissions. The form below is configured to send a GET request to forms-sample-response.php. On submit, jQuery Mobile will make sure that the Url specified is able to be retrieved via Ajax, and handle it appropriately. Keep in mind that just like ordinary HTTP form submissions, jQuery Mobile allows GET result pages to be bookmarked by updating the URL hash when the response returns successfully. Also like ordinary form submissions, POST requests do not contain query parameters in the hash, so they are not bookmarkable.

Non-Ajax form example

To prevent form submissions from being automatically handled with Ajax, add the data-ajax="false" attribute to the form element. You can also turn off Ajax form handling completely via the ajaxEnabled global config option.

The form below is identical to the one above except for the addition of the data-ajax="false" attribute. When the submit button is pressed, it will result in a full page refresh.

Self-submitting Forms

You can submit forms to the same URL you're currently viewing by setting the form's action attribute to that URL. This page demonstrates.

When a POST request is submitted to a page that's already in the DOM (which would commonly happen when submitting a form to the same URL currently in view), the response URL will be identical to that existing page, as POST requests do not append query string parameters to the URL. In this situation, jQuery Mobile will replace the page that submitted the form with the page returned in the response body.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\forms-themes.html jQuery Mobile Docs - Theming Forms

Theming forms

Home Search

Form themes

jQuery Mobile has a rich theming system that gives you full control of how pages and forms are styled. By default all form elements inside a container will automatically adopt the same theme color swatch as their parent. This allows form elements to blend into their layouts with minimal work. The data-theme attribute can be applied to any individual form element to apply any of the lettered theme color swatches to create contrast and emphasis in your designs.

All the form elements in the examples below use the same HTML code with no theme swatch specified on the individual form elements. The only difference between each example block code is a data-theme swatch color assigned to each parent container. This illustrates the way form elements automatically adopt the theme swatch of their parent.

Body swatch "a"

Font styling:
Choose a pet:

Body swatch "b"

Font styling:
Choose a pet:

Body swatch "c"

Font styling:
Choose a pet:

Body swatch "d"

Font styling:
Choose a pet:

Body swatch "e"

Font styling:
Choose a pet:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\index.html jQuery Mobile Docs - Forms

Form elements

Home Search

All form elements begin with standard HTML controls that are enhanced to make them more attractive and easy to use. In browsers that don't support the custom controls, they will still have a usable experience because these are all based on native form elements.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\plugin-eventsmethods.html jQuery Mobile Docs - Form Plugin Methods

Form Plugin Methods

Home Search

We've retired this page.

Plugin events and methods are now documented separately for each component (see links on the left).

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\checkboxes\events.html jQuery Mobile Docs - Checkboxes

Checkboxes

Home Search

Checkboxes

Bind events directly to the input element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

 
$("input[type='checkbox']").bind( "change", function(event, ui) {
  ...
});

The checkbox plugin has the following custom events:

create triggered when a checkbox is created

$("input[type='checkbox']").checkboxradio({
   create: function(event, ui) { ... }
});		
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\checkboxes\index.html jQuery Mobile Docs - Checkboxes

Checkboxes

Home Search

Checkboxes

Checkboxes are used to provide a list of options where more than one can be selected. Traditional desktop checkboxes are not optimized for touch input so in jQuery Mobile, we style the label for the checkboxes so they are larger and look clickable. A custom set of icons are added to the label to provide additional visual feedback.

The checkbox controls below use standard input/label markup, but are styled to be more touch-friendly. The styled control you see is actually the label element, which sits over the real input, so if images fail to load, you'll still have a functional control. In most browsers, clicking the label automatically triggers a click on the input, but we've had to trigger the update manually for a few mobile browsers that don't do this natively. On the desktop, these controls are keyboard and screen-reader accessible. View the data- attribute reference to see all the possible attributes you can add to checkboxes.

To create a single checkbox, add an input with a type="checkbox" attribute and a corresponding label. If the input isn’t wrapped in its corresponding label, be sure to set the for attribute of the label to match the id of the input so they are semantically associated.

There are therefore two ways to create a checkbox and with a label as shown below:

	
<label><input type="checkbox" name="checkbox-0" /> I agree </label>
			
<input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
<label for="checkbox-1">I agree</label>
		

The above snippets will produce two basic checkboxes. The default styles will set the width of the element to 100% of the parent container.

Mini version

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

	
<input type="checkbox" name="checkbox-0" id="checkbox-mini-0" class="custom" data-mini="true" />
<label for="checkbox-mini-0">I agree</label>

This will produce a checkbox that is not as tall as the standard version and has a smaller text size.

Field containers & Legends

Because checkboxes use the label element for the text displayed next to the checkbox form element, we recommend wrapping the checkbox in a fieldset element that has a legend which acts as the title for the question. Add the data-role="controlgroup" attribute to the fieldset so it can be styled in a parallel way as text inputs, selects or other form elements.

	
<div data-role="fieldcontain">
    <fieldset data-role="controlgroup">
	   <legend>Agree to the terms:</legend>
	   <input type="checkbox" name="checkbox-2" id="checkbox-2" class="custom" />
	   <label for="checkbox-2">I agree</label>
    </fieldset>
</div>
Agree to the terms:

Vertically grouped checkboxes

Typically, there are multiple checkboxes listed under a question title. To visually integrate multiple checkboxes into a grouped button set, the framework will automatically remove all margins between buttons and round only the top and bottom corners of the set if there is a data-role="controlgroup" attribute on the fieldset.

Choose as many snacks as you'd like:

Horizontal toggle sets

Checkboxes can also be used for grouped button sets where more than one button can be selected at once, such as the bold, italic and underline button group seen in word processors. To make a horizontal button set, add the data-type="horizontal" to the fieldset.

<fieldset data-role="controlgroup" data-type="horizontal">

The framework will float the labels so they sit side-by-side on a line, hide the checkbox icons and only round the left and right edges of the group.

Font styling:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\checkboxes\methods.html jQuery Mobile Docs - Checkboxes

Checkboxes

Home Search

Checkboxes

The checkbox has the following methods:

enable enable a disabled checkbox

 $("input[type='checkbox']").checkboxradio('enable');
				
disable disable a checkbox

$("input[type='checkbox']").checkboxradio('disable');
				
refresh update the checkbox
If you manipulate a checkbox via JavaScript, you must call the refresh method on it to update the visual styling.

$("input[type='checkbox']:first").attr("checked",true).checkboxradio("refresh");
				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\checkboxes\options.html jQuery Mobile Docs - Checkboxes

Checkboxes

Home Search

Checkboxes

The checkbox has the following options:

mini boolean

default: false

Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

$("input[type='checkbox']").checkboxradio({ mini: "true" });
theme string

default: null, inherited from parent

Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

$("input[type='checkbox']").checkboxradio({ theme: "a" });
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\radiobuttons\events.html jQuery Mobile Docs - Radio buttons

Radio buttons

Home Search

Radio buttons

Bind events directly to the input element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

 
$("input[type='radio']").bind( "change", function(event, ui) {
  ...
});

The radio button plugin has the following custom events:

create triggered when a radio button is created

$("input[type='radio']").checkboxradio({
   create: function(event, ui) { ... }
});		
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\radiobuttons\index.html jQuery Mobile Docs - Radio Buttons

Radio buttons

Home Search

Radio buttons

Radio buttons are used to provide a list of options where only a single item can be selected. Traditional desktop radio buttons are not optimized for touch input so jQuery Mobile styles the label for the radio buttons so they are larger and look clickable. A custom set of icons are added to the label to provide additional visual feedback.

The radio controls below use standard input/label markup, but are styled to be more touch-friendly. The styled control you see is actually the label element, which sits over the real input, so if images fail to load, you'll still have a functional control. In most browsers, clicking the label automatically triggers a click on the input, but we've had to trigger the update manually for a few mobile browsers that don't do this natively. On the desktop, these controls are keyboard and screen-reader accessible. View the data- attribute reference to see all the possible attributes you can add to radio buttons.

Vertically grouped radio buttons

To create a set of radio buttons, add an input with a type="radio" attribute and a corresponding label. Set the for attribute of the label to match the id of the input so they are semantically associated.

The label element is displayed next to the radio form element. Wrap the radio buttons in a fieldset element that has a legend which acts as the title for the question.

To visually integrate multiple radio buttons into a vertically grouped button set, the framework will automatically remove all margins between buttons and round only the top and bottom corners of the set if there is a data-role="controlgroup" attribute on the container.

	
<fieldset data-role="controlgroup">
	<legend>Choose a pet:</legend>
     	<input type="radio" name="radio-choice" id="radio-choice-1" value="choice-1" checked="checked" />
     	<label for="radio-choice-1">Cat</label>

     	<input type="radio" name="radio-choice" id="radio-choice-2" value="choice-2"  />
     	<label for="radio-choice-2">Dog</label>

     	<input type="radio" name="radio-choice" id="radio-choice-3" value="choice-3"  />
     	<label for="radio-choice-3">Hamster</label>

     	<input type="radio" name="radio-choice" id="radio-choice-4" value="choice-4"  />
     	<label for="radio-choice-4">Lizard</label>
</fieldset>

This will produce a vertically grouped radio button set. The default styles set the width of the button group to 100% of the parent container and stacks the legend on a separate line.

Choose a pet:

Mini version

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

			
<fieldset data-role="controlgroup" data-mini="true">
    	<input type="radio" name="radio-mini" id="radio-mini-1" value="choice-1" checked="checked" />
    	<label for="radio-mini-1">Credit</label>

	<input type="radio" name="radio-mini" id="radio-mini-2" value="choice-2"  />
    	<label for="radio-mini-2">Debit</label>
    	
    	<input type="radio" name="radio-mini" id="radio-mini-3" value="choice-3"  />
    	<label for="radio-mini-3">Cash</label>
</fieldset>

This will produce a radio button that is not as tall as the standard version and has a smaller text size.

Field containers

Optionally wrap the radiobuttons in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

	
<div data-role="fieldcontain">
    <fieldset data-role="controlgroup">
    	<legend>Choose a pet:</legend>
         	<input type="radio" name="radio-choice-2" id="radio-choice-21" value="choice-1" checked="checked" />
         	<label for="radio-choice-21">Cat</label>

         	<input type="radio" name="radio-choice-2" id="radio-choice-22" value="choice-2"  />
         	<label for="radio-choice-22">Dog</label>

         	<input type="radio" name="radio-choice-2" id="radio-choice-23" value="choice-3"  />
         	<label for="radio-choice-23">Hamster</label>

         	<input type="radio" name="radio-choice-2" id="radio-choice-24" value="choice-4"  />
         	<label for="radio-choice-24">Lizard</label>
    </fieldset>
</div>
	
Choose a pet:

Horizontal radio button sets

Radio buttons can also be used for grouped button sets where only a single button can be selected at once, such as a view switcher control. To make a horizontal radio button set, add the data-type="horizontal" to the fieldset.

<fieldset data-role="controlgroup" data-type="horizontal" >
Layout view:

The labels float so they sit side-by-side on a line. The radio button icons are hidden and only the left and right edges of the group are rounded.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\radiobuttons\methods.html jQuery Mobile Docs - Radio buttons

Radio buttons

Home Search

Radio buttons

The radio button has the following methods:

enable enable a disabled radio button

 $("input[type='radio']").checkboxradio('enable');
				
disable disable a radio button

$("input[type='radio']").checkboxradio('disable');
				
refresh update the radio button
If you manipulate a radio button via JavaScript, you must call the refresh method on it to update the visual styling.

$("input[type='radio']:first").attr("checked",true).checkboxradio("refresh");
				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\radiobuttons\options.html jQuery Mobile Docs - Radio buttons

Radio buttons

Home Search

Radio buttons

The radio button has the following options:

mini boolean

default: false

Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

$("input[type='radio']").checkboxradio({ mini: "true" });
theme string

default: null, inherited from parent

Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

$("input[type='radio']").checkboxradio({ theme: "a" });
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\search\events.html jQuery Mobile Docs - Search Input events

Search input

Home Search

Search input

Bind events directly to the input element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

 
$(".mySearchInput").bind( "change", function(event, ui) {
  ...
});

The text input plugin has the following custom events:

create triggered when a text input is created

$( ".selector" ).textinput({
   create: function(event, ui) { ... }
});		
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\search\index.html jQuery Mobile Docs - Search input

Search input

Home Search

Search input

Search inputs are a new HTML type that is styled with pill-shaped corners and adds an "x" icon to clear the field once you start typing. Start with an input with a type="search" attribute in your markup. View the data- attribute reference to see all the possible attributes you can add to search inputs.

Set the for attribute of the label to match the id of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

	
<label for="search-basic">Search Input:</label>
<input type="search" name="search" id="searc-basic" value="" />

This will produce a basic search input. The default styles set the width of the input to 100% of the parent container and stack the label on a separate line.

Mini version

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

	
<label for="search-mini">Search Input:</label>
<input type="search" name="search-mini" id="search-mini" value="" data-mini="true" />

This will produce a search input that is not as tall as the standard version and has a smaller text size.

Field containers

Optionally wrap the search input in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

	
<div data-role="fieldcontain">
    <label for="search-2">Search Input:</label>
    <input type="search" name="search-2" id="search-2" value="" />
</div>

The search input is now displayed like this:

Theming

The data-theme attribute can be added to the search input to set the theme to any swatch letter.

Setting the clear button text

The text for the button used to clear the search input of text can be configured for all search inputs by binding to the mobileinit event and setting the $.mobile.textinput.prototype.options.clearSearchButtonText property to a string of your choosing.

Calling the textinput plugin

This plugin will auto-initialize on any page that contains a text input with the type="search" attribute without any need for a data-role attribute in the markup. However, if needed, you can directly call the textinput plugin on a selector, just like any jQuery plugin:


$('.mySearchInput').textinput();			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\search\methods.html jQuery Mobile Docs - Search Input methods

Search input

Home Search

Search input

The text input plugin has the following methods:

enable enable a disabled text input

$('.selector').textinput('enable');			
				
disable disable a text input

$('.selector').textinput('disable');			
				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\search\options.html jQuery Mobile Docs - Text Search options

Search input

Home Search

Search input

The text input plugin has the following options:

initSelector CSS selector string

default: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input:not([type])"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as textinputs. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
   $.mobile.textinput.prototype.options.initSelector = ".myInputs";
});
mini boolean

default: false

Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

$('.selector').textinput({ mini: "true" });
theme string

default: null, inherited from parent

Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

$('.selector').textinput({ theme: "a" });
clearSearchButtonText string

default: "clear text"

Sets the text used for the button that clears the search input of text.

$('.selector').textinput({ clearSearchButtonText: "custom value" });
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\selects\custom.html jQuery Mobile Docs - Select

Select Menus

Home Search

Select menus

Custom select menus

The framework is capable of building a custom menu based on the select element's list of options. We recommend using a custom menu when multiple selections are required, or when the menu itself must be styled with CSS.

You can optionally use custom-styled select menus instead of the native OS menu. The custom menu supports disabled options and multiple selection (whereas native mobile OS support for both is inconsistent), adds an elegant way to handle placeholder values, and restores missing functionality on certain platforms such as optgroup support on Android (all explained below). In addition, the framework applies the custom button's theme to the menu to better match the look and feel and provide visual consistency across platforms. Lastly, custom menus often look better on desktop browsers because native desktop menus are smaller than their mobile counterparts and tend to look disproportionate.

Keep in mind that there is overhead involved in parsing the native select to build a custom menu. If there are a lot of selects on a page, or a select has a long list of options, this can impact the performance of the page, so we recommend using custom menus sparingly.

To use custom menus on a specific select, just add the data-native-menu="false" attribute. Alternately, this can also programmatically set the select menu's nativeMenu configuration option to false in a callback bound to the mobileinit event to achieve the same effect. This will globally make all selects use the custom menu by default. The following must be included in the page after jQuery is loaded but before jQuery Mobile is loaded.

$(document).bind('mobileinit',function(){
   $.mobile.selectmenu.prototype.options.nativeMenu = false;
});

When the select has a small number of options that will fit on the device's screen, the menu will appear as a small overlay with a pop transition:

When it has too many options to show on the device's screen, the framework will automatically create a new "page" populated with a standard list view for the options. This allows us to use the native scrolling included on the device for moving through a long list. The text inside the label is used as the title for this page.

Disabled options

jQuery Mobile will automatically disable and style option tags with the disabled attribute. In the demo below, the second option "Rush: 3 days" has been set to disabled.

Placeholder options

It's common for developers to include a "null" option in their select element to force a user to choose an option. If a placeholder option is present in your markup, jQuery Mobile will hide them in the overlay menu, showing only valid choices to the user, and display the placeholder text inside the menu as a header. A placeholder option is added when the framework finds:

  • An option with no value attribute (or an empty value attribute)
  • An option with no text node
  • An option with a data-placeholder="true" attribute. (This allows you to use an option that has a value and a textnode as a placeholder option).

You can disable this feature through the selectmenu plugin's hidePlaceholderMenuItems option, like this:

	
$.mobile.selectmenu.prototype.options.hidePlaceholderMenuItems = false;
	
	

Examples of various placeholder options:

Multiple selects

If the multiple attribute is present in your markup, jQuery Mobile will enhance the element with a few extra considerations:

  • A header element will be created inside the menu and display the placeholder text and a close button.
  • Clicking on an item inside the overlay menu will not close the widget.
  • A ghosted, unchecked icon will appear adjacent to each unselected item. When the item is selected the icon will change to a checkbox. Neither icon will appear inside a single select box.
  • Once 2+ items are selected, a counter element with the total number of selected items will appear inside the button.
  • The text of each selected item will appear inside the button as a list. If the button is not wide enough to display the entire list, it is truncated with an ellipses.
  • If no items are selected, the button's text will default to the placeholder text.
  • If no placeholder element exists, the default button text will be blank and the header will appear with just a close button. Because this isn't a friendly user experience, we recommended that you always specify a placeholder element when using multiple select boxes.

When a select is large enough to where the menu will open in a new page, the placeholder text is displayed in the button when no items are selected, and the label text is displayed in the menu's header. This differs from smaller overlay menus where the placeholder text is displayed in both the button and the header, and from full-page single selects where the placeholder text is not used at all.

Optgroup support

If a select menu contains optgroup elements, jQuery Mobile will create a divider & group items based on the label attribute's text:

Theming selects

You can specify any jQuery Mobile button data- attribute on a select element, too. In this example, we're setting the theme, icon and inline properties:

The data-overlay-theme attribute can be added to a select element to set the color of the overlay layer for the dialog-based custom select menus and the outer border of the smaller custom menus. By default, the content block colors for swatch "a"" will be used for the overlays.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\selects\events.html jQuery Mobile Docs - Select events

Select Menus

Home Search

Select menus

Bind events directly to the select element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

 
$(".mySelect").bind( "change", function(event, ui) {
  ...
});

The select menu plugin has the following custom events:

create triggered when a select menu is created

$( ".selector" ).selectmenu({
   create: function(event, ui) { ... }
});		
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\selects\index.html jQuery Mobile Docs - Select

Select Menus

Home Search

Select menus

The select menu is based on a native select element, which is hidden from view and replaced with a custom-styled select button that matches the look and feel of the jQuery Mobile framework. The select menu is ARIA-enabled and keyboard accessible on the desktop as well. View the data- attribute reference to see all the possible attributes you can add to selects.

By default, the framework leverages the native OS options menu to use with the custom button. When the button is clicked, the native OS menu will open. When a value is selected and the menu closes, the custom button's text is updated to match the selected value. Please note that the framework also offers the possibility of having custom (non-native) select menus; see details at the bottom of this page and on the custom select menu page.

To add a select menu to your page, start with a standard select element populated with a set of option elements. Set the for attribute of the label to match the id of the select so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

The framework will find all select elements and automatically enhance them into select menus, no need to apply a data-role attribute. To prevent the automatic enhancement of a select, add data-role="none" attribute to the select.


<label for="select-choice-0" class="select">Shipping method:</label>
<select name="select-choice-0" id="select-choice-0">
   <option value="standard">Standard: 7 day</option>
   <option value="rush">Rush: 3 days</option>
   <option value="express">Express: next day</option>
   <option value="overnight">Overnight</option>
</select>

This will produce a basic select menu. The default styles set the width of the input to 100% of the parent container and stacks the label on a separate line.

Mini version

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

	
<label for="select-choice-min" class="select">Shipping method:</label>
<select name="select-choice-min" id="select-choice-min" data-mini="true">
   <option value="standard">Standard: 7 day</option>
   <option value="rush">Rush: 3 days</option>
   <option value="express">Express: next day</option>
   <option value="overnight">Overnight</option>
</select> 

This will produce a select that a not as tall as the standard version and has a smaller text size.

Field containers

Optionally wrap the selects in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.


<div data-role="fieldcontain">
   <label for="select-choice-1" class="select">Shipping method:</label>
   <select name="select-choice-1" id="select-choice-1">
      <option value="standard">Standard: 7 day</option>
      <option value="rush">Rush: 3 days</option>
      <option value="express">Express: next day</option>
      <option value="overnight">Overnight</option>
   </select>
</div>

The select input is now displayed like this:

An example of a select with a long list of options:

Optgroups

The following example organizes the options into optgroup elements. Support for this feature in mobile selects is a bit spotty, but is improving.

Vertically grouped select inputs

To create a grouped set of select inputs, first add select and a corresponding label. Set the for attribute of the label to match the id of the select so they are semantically associated.

Because the label element will be associated with each individual select input, we recommend wrapping the selects in a fieldset element that has a legend which acts as the combined label for the grouped inputs.

Lastly, one needs to wrap the fieldset in a div with data-role="controlgroup" attribute, so it can be styled as a group.

	
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
	<legend>Date of Birth:</legend>

    <label for="select-choice-month">Month</label>
<select name="select-choice-month" id="select-choice-month">
	<option>Month</option>
	<option value="jan">January</option>
	<!-- etc. -->
</select>

	<label for="select-choice-day">Day</label>
<select name="select-choice-day" id="select-choice-day">
	<option>Day</option>
	<option value="1">1</option>
	<!-- etc. -->
</select>

<label for="select-choice-year">Year</label>
<select name="select-choice-year" id="select-choice-year">
	<option>Year</option>
	<option value="2011">2011</option>
	<!-- etc. -->
</select>
</fieldset>
</div>
Date of Birth:

Horizontally grouped select inputs

Select inputs can also be used for grouped sets with more than one related selections. To make a horizontal button set, add the data-type="horizontal" to the fieldset. Note that the buttons which trigger the select will resize depending on the currently selected option’s value. Note that browsers without support for display: inline-block; will group the selects vertically, as above.

<fieldset data-role="controlgroup" data-type="horizontal">
Date of Birth:

Calling the select menu plugin

The select menu plugin will auto initialize on any page that contains a select menu, without any need for a data-role attribute in the markup. However, you can directly call the select menu plugin on any selector, just like any normal jQuery plugin:


$('select').selectmenu();			

Theming selects

You can specify any jQuery Mobile button data- attribute on a select element, too. In this example, we're setting the theme, icon and inline properties:

Custom select menus

For the sake of advanced styling, the framework also offers a method of generating custom menus from existing select menu markup instead of the native OS menu. The custom menu supports disabled options and multiple selection (whereas native mobile OS support for both is inconsistent), adds an elegant way to handle placeholder values, and restores missing functionality on certain platforms such as optgroup support on Android.

Custom select menu docs

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\selects\methods.html jQuery Mobile Docs - Select methods

Select Menus

Home Search

Select menus

The select menu plugin has the following methods:

close close an open select menu

$('select').selectmenu('close');			
				
enable enable a disabled select

$('select').selectmenu('enable');			
				
disable disable a select.

$('select').selectmenu('disable');			
				
open open a closed select menu (custom menus only)

$('select').selectmenu('open');			
				
refresh update the custom select
This is used to update the custom select to reflect the native select element's value.If the number of options in the select are different than the number of items in the custom menu, it'll rebuild the custom menu. Also, if you pass a true argument you can force the rebuild to happen.

//refresh value			
$('select').selectmenu('refresh');

//refresh and force rebuild
$('select').selectmenu('refresh', true);
				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\selects\options.html jQuery Mobile Docs - Select options

Select Menus

Home Search

Select menus

The select menu plugin has the following options:

corners boolean

default: true

Applies the theme button border-radius to the select button if set to true. This option is also exposed as a data attribute: data-corners="false"

$('select').selectmenu({ corners: "false" });
icon string

default: "arrow-down"

Replaces the default icon "arrow-down" with an icon from the icon set. This option is also exposed as a data attribute: data-icon="star". Setting this attribute to "false" suppresses the icon.

$('select').selectmenu({ icon: "star" });

To suppress the icon, a boolean expression must be used:

$('select').selectmenu({ icon: false });
iconpos string

default: "right"

Position of the icon in the select button. Possible values: left, right, top, bottom, notext. The notext value will display the select as an icon-only button with no text feedback. This option is also exposed as a data attribute: data-iconpos="left"

$('select').selectmenu({ iconpos: "left" });
iconshadow boolean

default: true

Applies the theme shadow to the select button if set to true. This option is also exposed as a data attribute: data-iconshadow="false"

$('select').selectmenu({ iconshadow: "false" });
initSelector CSS selector string

default: "select:not(:jqmData(role='slider'))"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as select menus. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
	$.mobile.selectmenu.prototype.options.initSelector = ".myselect";
});
inline boolean

default: null (false)

If set to true, this will make the select button act like an inline button so the width is determined by the button's text. By default, this is null (false) so the select button is full width, regardless of the feedback content. Possible values: true, false. This option is also exposed as a data attribute: data-inline="true"

$('select').selectmenu({ inline: "true" });
mini boolean

default: false

Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

$('select').selectmenu({ mini: "true" });
nativeMenu boolean

default: true

When set to true, clicking the custom-styled select menu will open the native select menu which is best for performance. If set to false, the custom select menu style will be used instead of the native menu. This option is also exposed as a data attribute: data-native-menu="false"

$('select').selectmenu({ nativeMenu: "false" });
overlayTheme string

default: a

Sets the color of the overlay layer for the dialog-based custom select menus and the outer border of the smaller custom menus. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, the content block colors for swatch "a" will be used for the overlays. This option is also exposed as a data attribute: ui-body-d

$('select').selectmenu({ overlayTheme: "d" });
preventFocusZoom boolean

default: true on iOS platforms

This option disables page zoom temporarily when a custom select is focused, which prevents iOS devices from zooming the page into the select. By default, iOS often zooms into form controls, and the behavior is often unnecessary and intrusive in mobile-optimized layouts. This option is also exposed as a data attribute: data-prevent-focus-zoom="true"

$('select').selectmenu({ preventFocusZoom: true });
shadow boolean

default: true

Applies the drop shadow style to the select button if set to true. This option is also exposed as a data attribute: data-shadow="false"

$('select').selectmenu({ shadow: "false" });
theme string

default: null, inherited from parent

Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

$('select').selectmenu({ theme: "a" });
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\slider\events.html jQuery Mobile Docs - Slider events

Slider

Home Search

Slider

Bind events directly to the input element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

 
$( ".selector" ).bind( "change", function(event, ui) {
  ...
});

The slider plugin has the following custom event:

create triggered when a slider is created

$( ".selector" ).slider({
   create: function(event, ui) { ... }
});		
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\slider\index.html jQuery Mobile Docs - Slider

Slider

Home Search

Slider

To add a slider widget to your page, use a standard input with the type="range" attribute. The input's value is used to configure the starting position of the handle and the value is populated in the text input. Specify min and max attribute values to set the slider's range. If you want to constrain input to specific increments, add the step attribute. Set the value attribute to define the initial value. The framework will parse these attributes to configure the slider widget. View the data- attribute reference to see all the possible attributes you can add to sliders.

As you drag the slider's handle, the framework will update the native input's value (and vice-versa) so they are always in sync; this ensures that the value is submitted with the form.

Set the for attribute of the label to match the id of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

The framework will find all input elements with a type="range" and automatically enhance them into a slider with an accompanying input without any need to apply a data-role attribute. To prevent the automatic enhancement of this input into a slider, add data-role="none" attribute to the input and wrap them in a div with the data-role="fieldcontain" attribute to group them. In this example, the acceptable range is 0-100.


<label for="slider-1">Input slider:</label>
<input type="range" name="slider-1" id="slider-1" value="60" min="0" max="100" />

The default slider with these settings is displayed like this:

Step increment

To force the slider to snap to a specific increment, add the step attribute to the input. By default, the step is 1, but in this example, the step is 50 and the maximum value is 500.


<label for="slider-step">Input slider:</label>
<input type="range" name="slider-step" id="slider-step" value="150" min="0" max="500" step="50" />

This will produce an input that snaps to increments of 50. If a value is added to the input that isn't valid with the step increment, the value will be reset on blur to the closest step.

Fill highlight

To have a highlight fill on the track up to the slider handle position, add the data-highlight="true" attribute to the input. The fill uses active state swatch.


<label for="slider-fill">Input slider:</label>
<input type="range" name="slider-fill" id="slider-fill" value="60" min="0" max="100" data-highlight="true" />

Mini version

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.


<label for="slider-mini">Input slider:</label>
<input type="range" name="slider-mini" id="slider-mini" value="25" min="0" max="100" data-highlight="true" data-mini="true" />

This will produce a slider and its corresponding input that are not as tall as the standard version. The input also has a smaller text size.

Field containers

Optionally wrap the slider markup in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form. In this example, the step attribute is omitted to allow any whole number value to be selected.


<div data-role="fieldcontain">
   <label for="slider-2">Input slider:</label>
   <input type="range" name="slider-2" id="slider-2" value="25" min="0" max="100"  />
</div>

The slider is now displayed like this:

Sliders also respond to key commands. Right Arrow, Up Arrow and Page Up keys increase the value; Left Arrow, Down Arrow and Page Down keys decrease it. To move the slider to its minimum or maximum value, use the Home or End key, respectively.

Calling the slider plugin

This plugin will auto initialize on any page that contains a text input with the type="range" attribute. However, if needed you can directly call the slider plugin on any selector, just like any jQuery plugin:


$('input').slider();

Theming the slider

To set the theme swatch for the slider, add a data-theme attribute to the input which will apply the theme to both the input, handle and track. The track swatch can be set separately by adding the data-track-theme attribute to apply the down state version of the selected button swatch.


<div data-role="fieldcontain">
	<label for="slider-3">Input slider:</label>
	<input type="range" name="slider-3" id="slider-3" value="25" min="0" max="100" data-theme="a" data-track-theme="b" />
</div>
		

This will produce a themed slider:

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\slider\methods.html jQuery Mobile Docs - Slider methods

Slider

Home Search

Slider

The slider plugin has the following methods:

enable enable a disabled slider

$('.selector').slider('enable');			
				
disable disable a slider

$('.selector').slider('disable');			
				
refresh update the slider

If you manipulate a slider via JavaScript, you must call the refresh method on it to update the visual styling.

			
$('.selector').slider('refresh');
				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\slider\options.html jQuery Mobile Docs - Slider options

Slider

Home Search

Slider

The slider plugin has the following options:

disabled boolean

default: false

Sets the default state of the slider to disabled when "true".

$('.selector').slider({ disabled: "true" });
highlight boolean

default: false

Sets an active state fill on the track from the left edge to the slider handle when set to "true".

$('.selector').slider({ highlight: "true" });
initSelector CSS selector string

default: "input[type='range'], :jqmData(type='range'), :jqmData(role='slider')"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as sliders. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
   $.mobile.slider.prototype.options.initSelector = ".myslider";
});
mini boolean

default: false

Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

$('.selector').slider({ mini: "true" });
theme string

default: null, inherited from parent

Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as its parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

$('.selector').slider({ theme: "a" });
trackTheme string

default: null, inherited from parent

Sets the color scheme (swatch) for the slider's track, specifically. It accepts a single letter from a-z that maps to the swatches included in your theme.

$('.selector').slider({ trackTheme: "a" });

This option can be overridden in the markup by assigning a data attribute to the input, e.g. data-track-theme="a".

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\switch\events.html jQuery Mobile Docs - Slider events

Flip Toggle Switch

Home Search

Flip toggle switch

Bind events directly to the select element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

 
$( ".selector" ).bind( "change", function(event, ui) {
  ...
});

The slider plugin has the following custom event:

create triggered when a slider is created

$( ".selector" ).slider({
   create: function(event, ui) { ... }
});		
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\switch\index.html jQuery Mobile Docs - Switch

Flip Toggle Switch

Home Search

Flip toggle switch

A binary "flip" switch is a common UI element on mobile devices that is used for binary on/off or true/false data input. You can either drag the flip handle like a slider or tap one side of the switch.

To create a flip toggle, start with a select with two options. The first option will be styled as the "on" state switch and the second will be styled as the "off" state so write your options accordingly. View the data- attribute reference to see all the possible attributes you can add to flip switches.

Set the for attribute of the label to match the id of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

	
<label for="flip-1">Select slider:</label>
<select name="flip-1" id="flip-1" data-role="slider">
	<option value="off">Off</option>
	<option value="on">On</option>
</select> 

This will produce a basic flip toggle switch input. The default styles set the width of the switch to 100% of the parent container and stack the label on a separate line.

Longer Labels

The control is proportionally scaled, so to use longer labels one can just add a line of CSS setting the switch to the desired width. For example, given the following markup:


<div class="containing-element">
	<label for="flip-min">Flip switch:</label>
	<select name="flip-min" id="flip-min" data-role="slider">
		<option value="off">Switch Off</option>
		<option value="on">Switch On</option>
	</select>
</div>

.containing-element .ui-slider-switch { width: 9em } will produce:

As some default styles hinge on fieldcontains, note that you may have to ensure that custom styles apply to switches within fieldcontains by using .ui-field-contain div.ui-slider-switch { width: […]; }.

Mini version

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

	
<label for="flip-mini">Flip switch:</label>
<select name="flip-mini" id="flip-mini" data-role="slider" data-mini="true">
	<option value="off">Off</option>
	<option value="on">On</option>
</select>

This will produce a flip switch that is not as tall as the standard version and has a smaller text size.

Field containers

Optionally wrap the switch markup in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

	
<div data-role="fieldcontain">
<label for="flip-2">Flip switch:</label>
	<select name="flip-2" id="flip-2" data-role="slider">
		<option value="nope">Nope</option>
		<option value="yep">Yep</option>
	</select> 
</div>

The flip toggle switch is now displayed like this:

Theming the flip switch

Like all form elements, this widget will automatically inherit the theme from its parent container. To choose a specific theme color swatch, specify the data-theme attribute on the select and specify a swatch letter.

	
<div data-role="fieldcontain">
	<label for="flip-3">Flip switch:</label>
	<select name="flip-3" id="flip-3" data-role="slider" data-theme="a">
		<option value="no">No</option>
		<option value="yes">Yes</option>
	</select> 
</div>

This results in a switch with the swatch "a" colors for the handle. Note that the lefthand "on" state gets the active state color.

Here is a swatch "e" variation:

It is also possible to theme the track of the flip switch by adding the data-track-theme attribute and specifying the chosen swatch letter on the select.

Here's an example of a flip switch with the swatch "a" applied to the track and swatch "c" applied to the handle:

	
<div data-role="fieldcontain">
        <label for="flip-5">Flip switch:</label>
        <select name="flip-5" id="flip-5" data-role="slider" data-theme="c" data-track-theme="a">
                <option value="no">No</option>
                <option value="yes">Yes</option>
        </select>
</div>

Calling the switch plugin

This plugin will auto-initialize on any page that contains a select with the data-role="slider" attribute. However, if needed you can directly call the slider plugin on any selector, just like any jQuery plugin:


$('select').slider();			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\switch\methods.html jQuery Mobile Docs - Slider methods

Flip Toggle Switch

Home Search

Flip toggle switch

The slider plugin has the following methods:

enable enable a disabled slider

$('.selector').slider('enable');			
				
disable disable a slider

$('.selector').slider('disable');			
				
refresh update the slider

If you manipulate a slider via JavaScript, you must call the refresh method on it to update the visual styling.

			
$('.selector').slider('refresh');
				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\switch\options.html jQuery Mobile Docs - Slider options

Flip Toggle Switch

Home Search

Flip toggle switch

The slider plugin has the following options:

disabled boolean

default: false

Sets the default state of the slider to disabled when "true".

$('.selector').slider({ disabled: "true" });
initSelector CSS selector string

default: "input[type='range'], :jqmData(type='range'), :jqmData(role='slider')"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as sliders. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
   $.mobile.slider.prototype.options.initSelector = ".myslider";
});
mini boolean

default: false

Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

$('.selector').slider({ mini: "true" });
theme string

default: null, inherited from parent

Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

$('.selector').slider({ theme: "a" });
trackTheme string

default: null, inherited from parent

Sets the color scheme (swatch) for the slider's track, specifically. It accepts a single letter from a-z that maps to the swatches included in your theme.

$('.selector').slider({ trackTheme: "a" });

This option can be overridden in the markup by assigning a data attribute to the input, e.g. data-track-theme="a".

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\textinputs\events.html jQuery Mobile Docs - Text Input events

Text inputs

Home Search

Text inputs

Bind events directly to the input element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

 
$( ".selector" ).bind( "change", function(event, ui) {
  ...
});

The text input plugin has the following custom events:

create triggered when a text input is created

$( ".selector" ).textinput({
   create: function(event, ui) { ... }
});		
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\textinputs\index.html jQuery Mobile Docs - Text inputs

Text inputs

Home Search

Text inputs & Textareas

Text inputs and textareas are coded with standard HTML elements, then enhanced by jQuery Mobile to make them more attractive and useable on a mobile device. View the data- attribute reference to see all the possible attributes you can add to text inputs.

Text inputs

To collect standard alphanumeric text, use an input with a type="text" attribute. Set the for attribute of the label to match the id of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

	
    <label for="basic">Text Input:</label>
    <input type="text" name="name" id="basic" value=""  />

This will produce a basic text input. The default styles set the width of the input to 100% of the parent container and stack the label on a separate line.

Mini version

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

	
<label for="basic">Text Input:</label>
<input type="text" name="name" id="basic" value="" data-mini="true" />

This will produce an input that is not as tall as the standard version and has a smaller text size.

Field containers

Optionally wrap the text input in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

	
<div data-role="fieldcontain">
    <label for="name">Text Input:</label>
    <input type="text" name="name" id="name" value=""  />
</div>	

The text input is now displayed like this:

More text input types

In jQuery Mobile, you can use existing and new HTML5 input types such as password, email, tel, number, and more. Some type values are rendered differently across browsers. For example, Chrome renders the range input as a slider. jQuery Mobile standardizes the appearance of range and search by dynamically changing their type to text. You can configure which input types are degraded to text with the page plugin's options.

One major advantage of using these more specific input types if that on mobile devices, specialized keyboards that speed data entry are offered in place of the standard text keyboard. Try the following inputs on a mobile device to see which display custom keyboards on various platforms.

Textareas

For multi-line text inputs, use a textarea element. The framework will auto-grow the height of the textarea to avoid the need for an internal scrollbar.

Set the for attribute of the label to match the id of the textarea so they are semantically associated, and wrap them in a div with the data-role="fieldcontain" attribute to group them.

	
<label for="textarea-a">Textarea:</label>
<textarea name="textarea" id="textarea-a">
I'm a basic textarea. If this is pre-populated with content, the height will be automatically adjusted to fit without needing to scroll. That is a pretty handy usability feature.
</textarea>

This will produce a basic textarea with the width set to 100% of the parent container and the label stacked on a separate line. The textarea will grow to fit new lines as you type:

	
<div data-role="fieldcontain">
<label for="textarea">Textarea:</label>
	<textarea name="textarea" id="textarea"></textarea>
</div>

The textarea is displayed like this and will grow to fit new lines as you type:

Calling the textinput plugin

This plugin will auto initialize on any page that contains a textarea or any of the text input types listed above without any need for a data-role attribute in the markup. However, if needed, you can directly call the textinput plugin on any selector, just like any jQuery plugin:


$('input').textinput();			
			

Degraded input types

jQuery Mobile degrades several HTML5 input types back to type=text or type=number after adding enhanced controls. For example, inputs with a type of range are enhanced with a custom slider control, and their type is set to number to offer a usable form input alongside that slider. Inputs with a type of search are degraded back to type=text after we add our own themable search input styling.

The page plugin contains a list of input types that are set to either true which means they'll degrade to type=text, false which means they'll be left alone, or a string such as "number", which means they'll be converted to that type (such as the case of type=range).

You can configure which types are changed via the page plugin's degradeInputs option, which can be manipulated externally via $.mobile.page.prototype.options.degradeInputs, which has properties: color, date, datetime, "datetime-local", email, month, number, range, search, tel, time, url, and week. Be sure to configure this inside an event handler bound to the mobileinit event, so that it applies to the first page as well as subsequent pages that are loaded.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\textinputs\methods.html jQuery Mobile Docs - Text Input methods

Text inputs

Home Search

Text inputs

The text input plugin has the following methods:

enable enable a disabled text input

$('.selector').textinput('enable');			
				
disable disable a text input

$('.selector').textinput('disable');			
				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\forms\textinputs\options.html jQuery Mobile Docs - Text Input options

Text inputs

Home Search

Text inputs

The text input plugin has the following options:

initSelector CSS selector string

default: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input:not([type])"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as textinputs. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
   $.mobile.textinput.prototype.options.initSelector = ".myInputs";
});
mini boolean

default: false

Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

$('.selector').textinput({ mini: "true" });
preventFocusZoom boolean

default: true on iOS platforms

This option disables page zoom temporarily when a custom input is focused, which prevents iOS devices from zooming the page into the input. By default, iOS often zooms into form controls, and the behavior is often unnecessary and intrusive in mobile-optimized layouts. This option is also exposed as a data attribute: data-prevent-focus-zoom="true"

$('input').textinput({ preventFocusZoom: true });
theme string

default: null, inherited from parent

Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

$('.selector').textinput({ theme: "a" });
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\docs-lists.html jQuery Mobile Docs - Lists Overview

Lists

Home Search

List views

Basic linked lists

A list view is coded as a simple unordered list containing linked list items with a data-role="listview" attribute. jQuery Mobile will apply all the necessary styles to transform the list into a mobile-friendly list view with right arrow indicator that fills the full width of the browser window. When you tap on the list item, the framework will trigger a click on the first link inside the list item, issue an AJAX request for the URL in the link, create the new page in the DOM, then kick off a page transition. View the data- attribute reference to see all the possible attributes you can add to listviews.

Here is the HTML markup for a basic linked list.


<ul data-role="listview" data-theme="g">
	<li><a href="acura.html">Acura</a></li>
	<li><a href="audi.html">Audi</a></li>
	<li><a href="bmw.html">BMW</a></li>
</ul>
Basic list example

Style note on non-inset lists: all standard, non-inset lists have a -15px margin to negate the 15px of padding on the content area to make lists fill to the edges of the screen. If you add other widgets above or below a list, the negative margin may make these elements overlap so you'll need to add additional spacing in your custom CSS.

Nested lists

By nesting child ul or ol inside list items, you can create nested lists. When a list item with a child list is clicked, the framework will show a new page populated with the title of the parent in the header and the list of child elements. These dynamic nested lists are styled with the "b" theme swatch (blue in the default theme) to indicate that you are in a secondary level of navigation. Lists can be nested multiple levels deep and all pages and linking will be automatically handled by the framework. Note that the page of each nested listview is created when the parent page loads and for each nested page the page-events will trigger.

To set the swatch color of the child list views, set the data-theme attribute on each list inside.

Nested list example

Numbered lists

Lists can also be created from ordered lists (ol) which is useful when presenting items that are in a sequence such as search results or a movie queue. When the enhanced markup is applied to the list view, jQuery Mobile will try to first use CSS to add numbers to the list and, if not supported, will fall back to injecting numbers with JavaScript.

Numbered list example

Read-only lists

List views can also be used to display a non-interactive list of items, usually as an inset list. This list is built from an unordered or ordered list that don't have linked list items. The framework defaults to styling these list with the "c" theme swatch and sets the text size to a smaller size than the clickable lists to save a bit of space.

Read-only list example

Split button lists

In cases where there is more than one possible action per list item, a split button can be used to offer two independently clickable items -- the list item and a small arrow icon in the far right. To make a split list item, simply add a second link inside the li and the framework will add a vertical divider line, style the link as an icon-only arrow button, and set the title attribute of the link to the text the link for accessibility.

You can set the icon for the right split icon by specifying a data-split-icon attribute with the icon name you want. The theme swatch color of the split button defaults to "b" (blue in the default theme) but can be set by specifying a swatch letter in the data-split-theme attribute.

Split list example

List dividers

List items can be turned into dividers to organize and group the list items. This is done by adding the data-role="list-divider" to any list item. These items are styled with the bar swatch "b" by default (blue in the default theme) but you can specify a theme for dividers by adding the data-divider-theme attribute to the list element (ul or ol) and specifying a theme swatch letter.

List divider example

Search filter

jQuery Mobile provides a very easy way to filter a list with a simple client-side search feature. To make a list filterable, simply add the data-filter="true" attribute to the list. The framework will then append a search box above the list and add the behavior to filter out list items that don't contain the current search string as the user types. The input's placeholder text defaults to "Filter items...". To configure the placeholder text in the search input, you can either bind to the mobileinit event and set the $.mobile.listview.prototype.options.filterPlaceholder option to a string of your choosing, or use the data-attribute data-filter-placeholder on your listview. By default the search box will inherit its theme from its parent. The search box theme can be configured using the data-attribute data-filter-theme on your listview.

Search filter example

If you want to change the way in which list items are filtered, ie fuzzy search or matching from the beginning of the string, you can configure the callback used internally by defining $.mobile.listview.prototype.options.filterCallback during mobileinit or after the widget has been created with $("#mylist").listview('option', 'filterCallback', yourFilterFunction). Any function defined for the callback will be provided two arguments. First, the text of the current list item and second, the value being searched for. A truthy value will result in a hidden list item. The default callback which filters entries without the searchValue as a substring is described below:

function( text, searchValue ){
  return text.toLowerCase().indexOf( searchValue ) === -1;
};

To filter list items by values other than the text, add a data-filtertext attribute to the list item. The value of this attribute will be passed as the first argument to the filterCallback function instead of the text.

Hidden data filter example

Text formatting & counts

The framework includes text formatting conventions for common list patterns like header/descriptions, secondary information and counts through semantic HTML markup.

  • To add a count indicator to the right of the list item, wrap the number in an element with a class of ui-li-count
  • To add text hierarchy, use headings to increase font emphasis and use paragraphs to reduce emphasis.
  • Supplemental information can be added to the right of each list item by wrapping content in an element with a class of ui-li-aside
List with count bubbles List with text formatting

Thumbnails & icons

To add thumbnails to the left of a list item, simply add an image inside a list item as the first child element. The framework will scale the image to 80 pixels square. To use standard 16x16 pixel icons in list items, add the class of ui-li-icon to the image element.

List with thumbnail images List with icon images

Inset lists

If lists are embedded in a page with other types of content, an inset list packages the list into a block that sits inside the content area with a bit of margin and rounded corners (theme controlled). By adding the data-inset="true" attribute to the list (ul or ol), applies the inset appearance.

Inset list example

Calling the listview plugin

You can directly call the listview plugin on any selector, just like any jQuery plugin:

$('#mylist').listview();

Updating lists

If you add items to a listview, you'll need to call the refresh() method on it to update the styles and create any nested lists that are added. For example:

$('#mylist').listview('refresh');

Note that the refresh() method only affects new nodes appended to a list. This is done for performance reasons. Any list items already enhanced will be ignored by the refresh process. This means that if you change the contents or attributes on an already enhanced list item, these won't be reflected. If you want a list item to be updated, replace it with fresh markup before calling refresh.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\index.html jQuery Mobile Docs - Lists

Lists

Home Search

Lists are used for data display, navigation, result lists, and data entry so jQuery Mobile includes a wide range of list types and formatting examples to cover most common design patterns.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-all-full.html jQuery Mobile Docs - Lists

Linked list samples

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-count.html jQuery Mobile Docs - Lists Count Bubbles

Count bubble

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-divider.html jQuery Mobile Docs - List Dividers

List dividers

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-events.html jQuery Mobile Docs - Lists Overview

Lists

Home Search

List views

Bind events directly to the ol or ul element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:


$( ".selector" ).bind( "change", function(event, ui) {
  ...
});

The listview plugin has the following custom event:

create triggered when a listview is created

$( ".selector" ).listview({
   create: function(event, ui) { ... }
});
			
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-formatting.html jQuery Mobile Docs - List Formatting

List formatting

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-forms-inset.html jQuery Mobile Docs - Inset Lists with Forms

Inset with Forms

Home Search
  • Choose as many snacks as you'd like:
  • Font styling:
  • Choose a pet:
  • Layout view:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-forms.html jQuery Mobile Docs - Lists with Forms

Lists with Forms

Home Search
  • Choose as many snacks as you'd like:
  • Font styling:
  • Choose a pet:
  • Layout view:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-icons.html jQuery Mobile Docs - List Icons

Icons

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-inset.html jQuery Mobile Docs - Lists with Form Controls

Inset list samples

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-methods.html jQuery Mobile Docs - Lists Overview

Lists

Home Search

List views

The listview plugin has the following methods:

childPages retrieve the sub-pages

This method returns a jQuery object containing all the immediate child pages of a nested list.


$('.selector').listview('childPages');
				
refresh update the listview

If you manipulate a listview via JavaScript (e.g. add new LI elements), you must call the refresh method on it to update the visual styling.


$('.selector').listview('refresh');
				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-nested.html jQuery Mobile Docs - Nested Lists

Nested list

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-ol.html jQuery Mobile Docs - Ordered Lists

Numbered list

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-options.html jQuery Mobile Docs - Lists Overview

Lists

Home Search

List views

The listview plugin has the following options:

countTheme string

default: "c"

Sets the color scheme (swatch) for list item count bubbles. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.countTheme = "a";
});

This option is also exposed as a data attribute: data-count-theme="a".

dividerTheme string

default: "b"

Sets the color scheme (swatch) for list dividers. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.dividerTheme = "a";
});

This option is also exposed as a data attribute: data-divider-theme="a".

filter boolean

default: false

Adds a search filter bar to listviews. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.filter = true;
});

This option is also exposed as a data attribute: data-filter="true".

filterCallback function

The function to determine which rows to hide when the search filter textbox changes. The function accepts two arguments -- the text of the list item (or data-filtertext value if present), and the search string. Return true to hide the item, false to leave it visible. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.filterCallback = function( text, searchValue ) {
        // only show items that *begin* with the search string
        return text.toLowerCase().substring( 0, searchValue.length ) !== searchValue;
    };
});
filterPlaceholder string

default: "Filter items..."

The placeholder text used in search filter bars. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.filterPlaceholder = "Search...";
});

This option is also exposed as a data attribute: data-filter-placeholder="Search...".

filterTheme string

default: "c"

Sets the color scheme (swatch) for the search filter bar. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.filterTheme = "a";
});

This option is also exposed as a data attribute: data-filter-theme="a".

headerTheme string

default: "b"

Sets the color scheme (swatch) for headers of nested list sub pages. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.headerTheme = "a";
});

This option is also exposed as a data attribute: data-header-theme="a".

initSelector CSS selector string

default: ":jqmData(role='listview')"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as list views. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.initSelector = ".mylistview";
});
inset boolean

default: false

Adds inset list styles. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.inset = true;
});

This option is also exposed as a data attribute: data-inset="true".

splitIcon string

default: "arrow-r"

Applies an icon from the icon set to all split list buttons. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.splitIcon = "star";
});

This option is also exposed as a data attribute: data-split-icon="star".

splitTheme string

default: "b"

Sets the color scheme (swatch) for split list buttons. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.splitTheme = "a";
});

This option is also exposed as a data attribute: data-split-theme="a".

theme string

default: null, inherited from parent

Sets the color scheme (swatch) for this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as its parent container if not explicitly set. To set the value for all instances of this widget, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
    $.mobile.listview.prototype.options.theme = "a";
});

This option is also exposed as a data attribute: data-theme="a".

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-performance.html jQuery Mobile Docs - List Performance Test

500 item list

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-readonly-inset.html jQuery Mobile Docs - Readonly Inset Lists

Readonly Inset Lists

Home Search

Simple list

  • Acura
  • Audi
  • BMW
  • Cadillac
  • Ferrari

Count bubbles

  • Inbox 12
  • Outbox 0
  • Drafts 4
  • Sent 328
  • Trash 62

Numbered list

  1. The Godfather
  2. Inception
  3. The Good, the Bad and the Ugly
  4. Pulp Fiction
  5. Schindler's List

Divided, formatted content

  • Stephen Weber

    You've been invited to a meeting at Filament Group in Boston, MA

    Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.

    6:24PM

  • jQuery Team

    Boston Conference Planning

    In preparation for the upcoming conference in Boston, we need to start gathering a list of sponsors and speakers.

    9:18AM

Icon list

  • FranceFrance 4
  • GermanyGermany 4
  • Great BritainGreat Britain 0
  • FinlandFinland 12
  • NorwayNorway 328
  • United StatesUnited States 62

Thumbnail list

  • Broken Bells

    Broken Bells

  • Warning

    Hot Chip

  • Wolfgang Amadeus Phoenix

    Phoenix

Divided, filterable list

  • A
  • Adam Kinkaid
  • Alex Wickerham
  • Avery Johnson
  • B
  • Bob Cabot
  • C
  • Caleb Booth
  • Christopher Adams
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-readonly.html jQuery Mobile Docs - Inset Readonly Lists

Readonly lists

Home Search

Here is a variety of full-width lists that are read-only. If a list has the data-role="listview" attribute, but the contents aren't linked, it will display as read-only. These look like normal lists, except they don't have a right arrow and the text is set to a smaller size to save space.

Simple list

  • Acura
  • Audi
  • BMW
  • Cadillac
  • Ferrari

Count bubbles

  • Inbox 12
  • Outbox 0
  • Drafts 4
  • Sent 328
  • Trash 62

Numbered list

  1. The Godfather
  2. Inception
  3. The Good, the Bad and the Ugly
  4. Pulp Fiction
  5. Schindler's List

Divided, formatted content

  • Stephen Weber

    You've been invited to a meeting at Filament Group in Boston, MA

    Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.

    6:24PM

  • jQuery Team

    Boston Conference Planning

    In preparation for the upcoming conference in Boston, we need to start gathering a list of sponsors and speakers.

    9:18AM

Icon list

  • FranceFrance 4
  • GermanyGermany 4
  • Great BritainGreat Britain 0
  • FinlandFinland 12
  • NorwayNorway 328
  • United StatesUnited States 62

Thumbnail list

  • Broken Bells

    Broken Bells

  • Warning

    Hot Chip

  • Wolfgang Amadeus Phoenix

    Phoenix

Divided, filterable list

  • A
  • Adam Kinkaid
  • Alex Wickerham
  • Avery Johnson
  • B
  • Bob Cabot
  • C
  • Caleb Booth
  • Christopher Adams
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-search-filtertext.html jQuery Mobile Docs - Filtered Lists Using Hidden Data

Search hidden data

Home Search

By default, the listview filter simply searches against the content in each list item. If you want the filter to search against different content, add the data-filtertext attribute to the item and populate it with one or many keywords and phrases that should be used to match against. Note that if this attribute is added, the contents of the list item are ignored.

This attribute is useful for dealing with allowing for ticker symbols and full company names to be searched, or for covering common spellings and abbreviations for countries.

		
<li data-filtertext="NASDAQ:AAPL Apple Inc."><a href="#">Apple</a></li>
<li data-filtertext="USA U.S.A. United States of America"><a href="#">United States</a></li>
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-search-inset.html jQuery Mobile Docs - Filtered Inset Lists

Inset Search filter bar

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-search-with-dividers.html jQuery Mobile Docs - Filtered Lists with Dividers

List dividers

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-search.html jQuery Mobile Docs - Filtered Lists

Search filter bar

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-split-purchase.html jQuery Mobile Docs - Sample Dialog

Purchase?

This album costs $10.99 and includes 9 tracks.

Your download will begin immediately on your mobile device and all tracks will by added your your library next time you sync.

Purchase album No thanks
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-split.html jQuery Mobile Docs - Split Button Lists

Split button list

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-themes.html jQuery Mobile Docs - Theming Lists

Theming lists

Home Search

All the standard button swatches can be applied to lists. A list inherits its theme swatch from its parent page/content container. So the theme swatch defaults to "c" (silver in the default theme), if nothing else is set to the surrounding page/content containers. List dividers and split buttons are styled with bar swatch "b" by default (blue in the default theme). The default button swatch for count bubbles is "c" (silver in the default theme).

Below is a list which inherits the default "c" content swatch and uses the default swatches for the list divider and the count bubbles.

<ul data-role="listview" data-inset="true">

Theming list items

The list item color scheme can be changed to any button color theme swatch by adding the data-theme attribute to the list, and setting the letter theme swatch. Here is the same list as above with the swatch "a" applied.

<ul data-role="listview" data-inset="true" data-theme="a">

data-theme attributes also work at the LI-level, for styling a single item.

Theming dividers

The theme for list dividers can be set by adding the data-divider-theme to the list and specifying a swatch letter. Here is an example of the same list as above with swatch "e" set on the dividers.

<ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e">

Theming count bubbles

The theme for count bubbles can be set by adding the data-count-theme to the list and specifying a swatch letter. Here is an example with swatch "b" set on the count bubbles.

<ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e" data-count-theme="b">

Theming icons

The default icon for each list item containing a link is arrow-r. To override this, set the data-icon attribute on the desired list item to the name of a standard icon. To prevent icons from appearing altogether, set the data-icon attribute to "false". With a bit of custom styles it's also possible to use third party icons.

Markup for the listview:


<ul data-role="listview" data-inset="true" data-theme="b">
	<li data-role="list-divider">Divider</li>
	<li data-icon="home"><a href="#">data-icon="home"</a></li>
	<li data-icon="delete"><a href="#">data-icon="delete"</a></li>
	<li data-icon="plus"><a href="#">data-icon="plus"</a></li>
	<li data-icon="arrow-u"><a href="#">data-icon="arrow-u"</a></li>
	<li data-icon="arrow-d"><a href="#">data-icon="arrow-d"</a></li>
	<li data-icon="check"><a href="#">data-icon="check"</a></li>
	<li data-icon="gear"><a href="#">data-icon="gear"</a></li>
	<li data-icon="grid"><a href="#">data-icon="grid"</a></li>
	<li data-icon="star"><a href="#">data-icon="star"</a></li>
	<li data-icon="custom" id="coffeeicon"><a href="#">custom-icon</a></li>
	<li data-icon="arrow-r"><a href="#">data-icon="arrow-r"</a></li>
	<li data-icon="arrow-l"><a href="#">data-icon="arrow-l"</a></li>
	<li data-icon="minus"><a href="#">data-icon="minus"</a></li>
	<li data-icon="refresh"><a href="#">data-icon="refresh"</a></li>
	<li data-icon="forward"><a href="#">data-icon="forward"</a></li>
	<li data-icon="back"><a href="#">data-icon="back"</a></li>
	<li data-icon="alert"><a href="#">data-icon="alert"</a></li>
	<li data-icon="info"><a href="#">data-icon="info"</a></li>
	<li data-icon="search"><a href="#">data-icon="search"</a></li>
	<li data-icon="false"><a href="#">data-icon="false"</a></li>
</ul>

Styles for the custom icon:


<style>
	#coffeeicon .ui-icon-custom {
	background-image: url("../toolbars/glyphish-icons/34-coffee.png");
	background-position: 2px 2px;
	background-size: 90%; }
</style>

Custom icon by Joseph Wain / glyphish.com. Licensed under the Creative Commons Attribution 3.0 United States License.

Theming split buttons

For split lists with a second link button, the framework default to "b" for the theme swatch (blue in the default theme). Here is a default split list:

<ul data-role="listview" data-inset="true" data-split-theme="a">

To specify the color swatch for the icon button on the right, add the data-split-theme to the list and specify a swatch letter. This attribute can also be added to individual split inside list items by adding a data-theme attribute to specific links (see second list item).

The icon for the split theme can set at the list level by adding the data-split-icon to the list and specifying a standard icon. This attribute can also be added to individual split inside list items by adding a data-icon attribute to specific links (see second list item).

<ul data-role="listview" data-inset="true" data-split-theme="d" data-split-icon="delete">

Examples of all basic list swatches

Swatch "a" on listview

Swatch "b" on listview

Swatch "c" on listview

Swatch "d" on listview

Swatch "e" on listview

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-thumbnails.html jQuery Mobile Docs - Lists with Thumbnails

Thumbnails

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\lists\lists-ul.html jQuery Mobile Docs - Basic Lists

Basic list

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog-alt.html jQuery Mobile Framework - Dialog Example

Dialog

I'm colorful

This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.

Good for you Don't care, really
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog-buttons.html jQuery Mobile Framework - Dialog Example

Share Photos

Email Upload to flickr Share on Facebook Tweet photo Cancel
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog-overlay.html jQuery Mobile Framework - Dialog Example

Dialog

Custom overlay

This dialog adds data-overlay-theme="e" to the page container to set the overlay swatch color.

I like it
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog-success.html jQuery Mobile Framework - Dialog Example

Flickr upload:

Photos posted successfully

View photo page Done
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog-with-select.html jQuery Mobile Framework - Dialog Example with Select

Dialog select test

Open dialog

Sample Dialogs

Real Submit Would go here
Cancel
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dialog.html jQuery Mobile Framework - Dialog Example

Dialog

Delete page?

This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.

Sounds good Cancel
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\index.html jQuery Mobile Docs - Pages

Pages

Home Search

jQuery Mobile includes automatic AJAX page loading of external pages with back button history support, a set of animated page transitions and simple tools for displaying pages as dialogs.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\multipage-template.html Multi-page template

Multi-page

One

I have an id of "one" on my page container. I'm first in the source order so I'm shown when the page loads.

This is a multi-page boilerplate template that you can copy to build your first jQuery Mobile page. This template contains multiple "page" containers inside, unlike a single page template that has just one page within it.

Just view the source and copy the code to get started. All the CSS and JS is linked to the jQuery CDN versions so this is super easy to set up. Remember to include a meta viewport tag in the head to set the zoom level.

You link to internal pages by referring to the id of the page you want to show. For example, to link to the page with an id of "two", my link would have a href="#two" in the code.

Show internal pages:

Show page "two"

Show page "popup" (as a dialog)

Page Footer

Two

Two

I have an id of "two" on my page container. I'm the second page container in this multi-page template.

Notice that the theme is different for this page because we've added a few data-theme swatch assigments here to show off how flexible it is. You can add any content or widget to these pages, but we're keeping these simple.

Back to page "one"

Page Footer

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-anatomy.html jQuery Mobile Docs - Anatomy of a Page

Anatomy of a Page

Home Search

The jQuery Mobile "page" structure is optimized to support either single pages, or local internal linked "pages" within a page.

The goal of this model is to allow developers to create websites using best practices — where ordinary links will "just work" without any special configuration — while creating a rich, native-like experience that can't be achieved with standard HTTP requests.

Mobile page structure

A jQuery Mobile site must start with an HTML5 'doctype' to take full advantage of all of the framework's features. (Older devices with browsers that don't understand HTML5 will safely ignore the 'doctype' and various custom attributes.)

In the 'head', references to jQuery, jQuery Mobile and the mobile theme CSS are all required to start things off. jQuery Mobile 1.1 works with both 1.6.4 and 1.7.1 versions of jQuery core. We recommend linking to the files hosted on the jQuery CDN for best performance:


<!DOCTYPE html> 
<html> 
	<head> 
	<title>Page Title</title> 
	
	<meta name="viewport" content="width=device-width, initial-scale=1"> 

	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
	<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
</head> 

<body> 
...content goes here...
</body>
</html>

Viewport meta tag

Note above that there is a meta viewport tag in the head to specify how the browser should display the page zoom level and dimensions. If this isn't set, many mobile browsers will use a "virtual" page width around 900 pixels to make it work well with existing desktop sites but the screens may look zoomed out and too wide. By setting the viewport attributes to content="width=device-width, initial-scale=1", the width will be set to the pixel width of the device screen.

<meta name="viewport" content="width=device-width, initial-scale=1"> 

These settings do not disable the user's ability to zoom the pages, which is nice from an accessibility perspective. There is a minor issue in iOS that doesn't properly set the width when changing orientations with these viewport settings, but this will hopefully be fixed in a future release. You can set other viewport values to disable zooming if required since this is part of your page content, not the library.

Inside the body: Pages

Inside the <body> tag, each view or "page" on the mobile device is identified with an element (usually a div) with the data-role="page" attribute. View the data- attribute reference to see all the possible attributes you can add to pages.

<div data-role="page"> 
	...
</div> 

Within the "page" container, any valid HTML markup can be used, but for typical pages in jQuery Mobile, the immediate children of a "page" are divs with data-roles of "header", "content", and "footer".

<div data-role="page"> 
	<div data-role="header">...</div> 
	<div data-role="content">...</div> 
	<div data-role="footer">...</div> 
</div> 

Putting it together: Basic single page template

Putting it all together, this is the standard boilerplate page template you should start with on a project:


<!DOCTYPE html> 
<html> 
	<head> 
	<title>Page Title</title> 
	
	<meta name="viewport" content="width=device-width, initial-scale=1"> 

	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
	<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
</head> 
<body> 

<div data-role="page">

	<div data-role="header">
		<h1>Page Title</h1>
	</div><!-- /header -->

	<div data-role="content">	
		<p>Page content goes here.</p>		
	</div><!-- /content -->

	<div data-role="footer">
		<h4>Page Footer</h4>
	</div><!-- /footer -->
</div><!-- /page -->

</body>
</html>
View boilerplate template

Multi-page template structure

A single HTML document can contain multiple 'pages' that are loaded together by stacking multiple divs with a data-role of "page". Each 'page' block needs a unique ID (id="foo") that will be used to link internally between 'pages' (href="#foo"). When a link is clicked, the framework will look for an internal 'page' with the ID and transition it into view.

Here is an example of a 2 "page" site built with two jQuery Mobile divs navigated by linking to an ID placed on each page wrapper. Note that the IDs on the page wrappers are only needed to support the internal page linking, and are optional if each page is a separate HTML document. Here is what two pages look inside the body element.


<body> 

<!-- Start of first page -->
<div data-role="page" id="foo">

	<div data-role="header">
		<h1>Foo</h1>
	</div><!-- /header -->

	<div data-role="content">	
		<p>I'm first in the source order so I'm shown as the page.</p>		
		<p>View internal page called <a href="#bar">bar</a></p>	
	</div><!-- /content -->

	<div data-role="footer">
		<h4>Page Footer</h4>
	</div><!-- /footer -->
</div><!-- /page -->


<!-- Start of second page -->
<div data-role="page" id="bar">

	<div data-role="header">
		<h1>Bar</h1>
	</div><!-- /header -->

	<div data-role="content">	
		<p>I'm the second in the source order so I'm hidden when the page loads. I'm just shown if a link that references my ID is beeing clicked.</p>		
		<p><a href="#foo">Back to foo</a></p>	
	</div><!-- /content -->

	<div data-role="footer">
		<h4>Page Footer</h4>
	</div><!-- /footer -->
</div><!-- /page -->
</body>
View multi-page template

PLEASE NOTE: Since we are using the hash to track navigation history for all the Ajax 'pages', it's not currently possible to deep link to an anchor (index.html#foo) on a page in jQuery Mobile, because the framework will look for a 'page' with an ID of #foo instead of the native behavior of scrolling to the content with that ID.

The id attribute of all your elements must be not only unique on a given page, but also unique across the pages in a site. This is because jQuery Mobile's single-page navigation model allows many different "pages" to be present in the DOM at the same time. This also applies when using a multi-page template, since all "pages" on the template are loaded at once.

Conventions, not requirements

Although the page structure outlined above is a recommended approach for a standard web app built with jQuery Mobile, the framework is very flexible with document structure. The page, header, content, and footer data-role elements are optional and are mostly helpful for providing some basic formatting and structure. The page wrapper that used to be required for auto-initialization to work is now optional for single page documents, so there isn't any required markup at all. For a web page with a custom layout, all of these structural elements can be omitted and the Ajax navigation and all widgets will work just like they do in the boilerplate structure. Behind the scenes, the framework will inject the page wrapper if it's not included in the markup because it’s needed for managing pages, but the starting markup can now be extremely simple.

Note that in a multi-page setup, you are required to have page wrappers in your markup in order to group the content into multiple pages.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-cache.html jQuery Mobile Docs - Prefetching & caching pages

Prefetching & caching pages

Home Search

Prefetching pages

Usually, it's a good idea to store your app's pages in several single-page templates instead of one large multi-page template. This minimizes the size of the page's DOM.

When using single-page templates, you can prefetch pages into the DOM so that they're available instantly when the user visits them. To prefetch a page, add the data-prefetch attribute to a link that points to the page. jQuery Mobile then loads the target page in the background after the primary page has loaded and the pagecreate event has triggered. For example:


<a href="prefetchThisPage.html" data-prefetch> ... </a>

You can prefetch as many linked pages as you like. Just add data-prefetch to all the links you want to prefetch.

Alternatively, you can prefetch a page programmatically using $.mobile.loadPage():


$.mobile.loadPage( pageUrl, { showLoadMsg: false } );

Another advantage of prefetching a page is that the user doesn't see the Ajax loading message when visiting the prefetched page. The Ajax loading message only appears if the framework hasn't finished prefetching the page by the time the link is followed.

Prefetching pages naturally creates additional HTTP requests and uses bandwidth, so it's wise to use this feature only in situations where it's highly likely that the prefetched page will be visited. A common scenario is a photo gallery, where you can prefetch the "previous" and "next" photo pages so that the user can move quickly between photos.

DOM size management

For animated page transitions to work, the pages you're transitioning from and to both need to be in the DOM. However, keeping old pages in the DOM quickly fills the browser's memory, and can cause some mobile browsers to slow down or even crash.

jQuery Mobile therefore has a simple mechanism to keep the DOM tidy. Whenever it loads a page via Ajax, jQuery Mobile flags the page to be removed from the DOM when you navigate away from it later (technically, on the pagehide event). If you revisit a removed page, the browser may be able to retrieve the page's HTML file from its cache. If not, it refetches the file from the server. (In the case of nested list views, jQuery Mobile removes all the pages that make up the nested list once you navigate to a page that's not part of the list.)

Pages inside a multi-page template aren't affected by this feature at all - jQuery Mobile only removes pages loaded via Ajax.

Caching pages in the DOM

If you prefer, you can tell jQuery Mobile to keep previously-visited pages in the DOM instead of removing them. This lets you cache pages so that they're available instantly if the user returns to them.

To keep all previously-visited pages in the DOM, set the domCache option on the page plugin to true, like this:


$.mobile.page.prototype.options.domCache = true;

Alternatively, to cache just a particular page, you can add the data-dom-cache="true" attribute to the page's container:


<div data-role="page" id="cacheMe" data-dom-cache="true">

You can also cache a page programmatically like this:


pageContainerElement.page({ domCache: true });

The drawback of DOM caching is that the DOM can get very large, resulting in slowdowns and memory issues on some devices. If you enable DOM caching, take care to manage the DOM yourself and test thoroughly on a range of devices.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-customtransitions.html jQuery Mobile Docs - Transitions

Transitions

Home Search

Creating custom CSS-based transitions

To create a custom CSS transition, select a class name that corresponds to the name of your transition, for example "slide", and then define your "in" and "out" CSS rules to take advantage of transitions or animation keyframes:


		.slide.in {
		 	-webkit-transform: translateX(0);
			-moz-transform: translateX(0);
			-webkit-animation-name: slideinfromright;
			-moz-animation-name: slideinfromright;
		}
			
		.slide.out {
			-webkit-transform: translateX(-100%);
			-moz-transform: translateX(-100%);
			-webkit-animation-name: slideouttoleft;
			-moz-animation-name: slideouttoleft;
		}

		@-webkit-keyframes slideinfromright {
			from { -webkit-transform: translateX(100%); }
			to { -webkit-transform: translateX(0); }
		}
		
		@-webkit-keyframes slideouttoleft {
			from { -webkit-transform: translateX(0); }
			to { -webkit-transform: translateX(-100%); }
		}
	
		@-moz-keyframes slideinfromright {
			from { -moz-transform: translateX(100%); }
			to { -moz-transform: translateX(0); }
		}
		
		@-moz-keyframes slideouttoleft {
			from { -moz-transform: translateX(0); }
			to { -moz-transform: translateX(-100%); }
		}
		
				

During a CSS-based page transition, jQuery Mobile will place the class name of the transition on both the "from" and "to" pages involved in the transition. It then places an "out" class on the "from" page, and "in" class on the "to" page. The presence of these classes on the "from" and "to" page elements then triggers the animation CSS rules defined above. As of jQuery Mobile version 1.1, animation class additions are queued, rather than simultaneous, producing an out-then-in sequence, which is friendlier for mobile rendering than our previous simultaneous transition sequence.

If your transition supports a reverse direction, you need to create CSS rules that use the reverse class in addition to the transition class name and the "in" and "out" classes:


		.slide.in.reverse {
			-webkit-transform: translateX(0);
			-moz-transform: translateX(0);
			-webkit-animation-name: slideinfromleft;
			-moz-animation-name: slideinfromleft;
		}

		.slide.out.reverse {
			-webkit-transform: translateX(100%);
			-moz-transform: translateX(100%);
			-webkit-animation-name: slideouttoright;
			-moz-animation-name: slideouttoright;
		}

		@-webkit-keyframes slideinfromleft {
			from { -webkit-transform: translateX(-100%); }
			to { -webkit-transform: translateX(0); }
		}

		@-webkit-keyframes slideouttoright {
			from { -webkit-transform: translateX(0); }
			to { -webkit-transform: translateX(100%); }
		}
		
		@-moz-keyframes slideinfromleft {
			from { -moz-transform: translateX(-100%); }
			to { -moz-transform: translateX(0); }
		}

		@-moz-keyframes slideouttoright {
			from { -moz-transform: translateX(0); }
			to { -moz-transform: translateX(100%); }
		}
		
				

After the CSS rules are in place, you simply specify the name of your transition within the @data-transition attribute of a navigation link:

<a href="#page2" data-transition="slide">Page 2</a>
				

When the user clicks on the navigation link, jQuery Mobile will invoke your transition when it navigates to the page mentioned within the link.

In case you were wondering why none of the CSS rules above specified any easing or duration, it's because the CSS for jQuery Mobile defines the default easing and duration in the following rules:


		.in {
			-webkit-animation-timing-function: ease-out;
			-webkit-animation-duration: 350ms;
			-moz-animation-timing-function: ease-out;
			-moz-animation-duration: 350ms;
		}

		.out {
			-webkit-animation-timing-function: ease-in;
			-webkit-animation-duration: 225ms;
			-moz-animation-timing-function: ease-in;
			-moz-animation-duration: 225;
		}
				

If you need to specify a different easing or duration, simply add the appropriate CSS3 property to your custom page transition rules.

Creating custom JavaScript-based transitions

When a user clicks on a link within a page, jQuery Mobile checks if the link specifies a @data-transition attribute. The value of this attribute is the name of the transition to use when displaying the page referred to by the link. If there is no @data-transition attribute, the transition name specified by the configuration option $.mobile.defaultPageTransition is used for pages, and $.mobile.defaultDialogTransition is used for dialogs.

After the new page is loaded, the $.mobile.transitionHandlers dictionary is used to see if any transition handler function is registered for the given transition name. If a handler is found, that handler is invoked to start and manage the transition. If no handler is found the handler specified by the configuration option $.mobile.defaultTransitionHandler is invoked.

By default, the $.mobile.transitionHandlers dictionary is only populated with a single handler entry called "default". This handler plays a dual purpose of either executing a "none" transition, which removes the "ui-page-active" class from the page we are transitioning "from", and places it on the page we are transitioning "to", or a Queued CSS3 Animated Transition, such as the one explained above. If the transition is "none", it will be instantaneous; no animation, no fanfare.

The $.mobile.defaultTransitionHandler points to a handler function that assumes the name is a CSS class name, and implements the "Pure CSS3 Based Transitions" section above.

The default transition handler is available on the $.mobile namespace:


$.mobile.transitionHandlers[ "default" ];
		

Transition Handlers

A transition handler is a function with the following call signature:


function myTransitionHandler(name, reverse, $to, $from)
{
    var deferred = new $.Deferred();

    // Perform any actions or set-up necessary to kick-off
    // your transition here. The only requirement is that
    // whenever the transition completes, your code calls
    // deferred.resolve(name, reverse, $to, $from).

    // Return a promise.
    return deferred.promise();
}
		

Your handler must create a Deferred object and return a promise to the caller. The promise is used to communicate to the caller when your transition is actually complete. It is up to you to call deferred.resolve() at the correct time. If you are new to Deferred objects, you can find documentation here.

Registering and Invoking Your Transition Handler

Once you have created a transition handler function, you need to tell jQuery Mobile about it. To do this, simply add your handler to the $.mobile.transitionHandlers dictionary. Remember, the key used should be the name of your transition. This name is also the same name that will be used within the @data-transition attribute of any navigation links.


// Define your transition handler:

function myTransitionHandler(name, reverse, $to, $from)
{
    var deferred = new $.Deferred();

    // Perform any actions or set-up necessary to kick-off
    // your transition here. The only requirement is that
    // whenever the transition completes, your code calls
    // deferred.resolve(name, reverse, $to, $from).

    // Return a promise.
    return deferred.promise();
}

// Register it with jQuery Mobile:

$.mobile.transitionHandlers["myTransition"] = myTransitionHandler;
		

Once you've registered your handler, you can invoke your transition by placing a data-transition attribute on a link:

<a href="#page2" data-transition="myTransition">Page 2</a>
		

When the user clicks the link above, your transition handler will be invoked after the page is loaded and it is ready to be shown.

Overriding a CSS Transition With Your Own Handler

As previously mentioned the default transition handler assumes that any transition name other than "none" is a CSS class to be placed on the "from" and "to" elements to kick off a CSS3 animation. If you would like to override one of these built-in CSS transitions, you simply register your own handler with the same name as the CSS page transition you want to override. So for example, if I wanted to override the built-in "slide" CSS transition with my own JavaScript based transition, I would simply do the following:

// Define your transition handler:

function myTransitionHandler(name, reverse, $to, $from)
{
    var deferred = new $.Deferred();

    // Perform any actions or set-up necessary to kick-off
    // your transition here. The only requirement is that
    // whenever the transition completes, your code calls
    // deferred.resolve(name, reverse, $to, $from).

    // Return a promise.
    return deferred.promise();
}

// Register it with jQuery Mobile:

$.mobile.transitionHandlers["slide"] = myTransitionHandler;
		

Once you do this, anytime the "slide" transition is invoked, your handler, instead of the default one, will be called to perform the transition.

Overriding the Default Transition Handler

The $.mobile.css3TransitionHandler function is the default transition handler that gets invoked when a transition name is used and not found in the $.mobile.transitionHandlers dictionary. If you want to install your own custom default handler, you simply set the $.mobile.defaultTransitionHandler to your handler:

// Define your default transition handler:

function myTransitionHandler(name, reverse, $to, $from)
{
    var deferred = new $.Deferred();

    // Perform any actions or set-up necessary to kick-off
    // your transition here. The only requirement is that
    // whenever the transition completes, your code calls
    // deferred.resolve(name, reverse, $to, $from).

    // Return a promise.
    return deferred.promise();
}

$.mobile.defaultTransitionHandler = myTransitionHandler;
		

Once you do this, your handler will be invoked any time a transition name is used but not found within the $.mobile.transitionHandlers dictionary.

A model for Custom transition handler development

Transition handlers involve a number of critical operations, such as hiding any existing page, showing the new page, scrolling either to the top or a remembered scroll position on that new page, setting focus on the new page, and any animation and timing sequences you'd like to add. During development, we would recommend using jquery.mobile.transitions.js as a coding reference.

Transitions and scroll position

One of the key things jQuery Mobile does is store your scroll position before starting a transition so it can restore you to the same place once you return to the page when hitting the Back button or closing a dialog. Here are the same buttons from the top to test the scrolling logic.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-dialogs.html jQuery Mobile Docs - Dialogs

Dialogs

Home Search

Creating dialogs

Any page can be presented as a modal dialog by adding the data-rel="dialog" attribute to the page anchor link. When the "dialog" attribute is applied, the framework adds styles to add rounded corners, margins around the page and a dark background to make the "dialog" appear to be suspended above the page.

<a href="foo.html" data-rel="dialog">Open dialog</a>

Open dialog

Transitions

By default, the dialog will open with a 'pop' transition. Like all pages, you can specify any page transition you want on the dialog by adding the data-transition attribute to the link. To make it feel more dialog-like, we recommend specifying a transition of "pop", "slideup" or "flip".

<a href="foo.html" data-rel="dialog" data-transition="pop">Open dialog</a>
data-transition="pop" data-transition="slidedown" data-transition="flip"

Closing dialogs

When any link is clicked within in a dialog, the framework will automatically close the dialog and transition to the requested page, just as if the dialog were a normal page. To create a "cancel" button in a dialog, just link to the page that triggered the dialog to open and add the data-rel="back" attribute to your link. This pattern of linking to the previous page is also usable in non-JS devices as well.

For JavaScript-generated links, you can simply set the href attribute to "#" and use the data-rel="back" attribute. You can also call the dialog's close() method to programmatically close dialogs, for example: $('.ui-dialog').dialog('close').

Setting the close button text

Just like the page plugin, you can set a dialog's close button text through an option or data attribute. The option can be configured for all dialogs by binding to the mobileinit event and setting the $.mobile.dialog.prototype.options.closeBtnText property to a string of your choosing, or you can place the data attribute data-close-btn-text to configure the text from your markup.

History & Back button behavior

Since dialogs are typically used to support actions within a page, the framework does not include dialogs in the hash state history tracking. This means that dialogs will not appear in your browsing history chronology when the Back button is clicked. For example, if you are on a page, click a link to open a dialog, close the dialog, then navigate to another page, if you were to click the browser's Back button at that point you will navigate back to the first page, not the dialog.

Styling & theming

Dialogs can be styled with different theme swatches, just like any page by adding data-theme attributes to the header, content, or footer containers. Here is an example of a different dialog design:

An alternate color scheme

Dialogs appear to be floating above an overlay layer. This overlay adopts the swatch A content color by default, but the data-overlay-theme attribute can be added to the page wrapper to set the overlay to any swatch letter. Here is an example of a dialog with the overlay set to swatch e:

Custom overlay swatch

Dialogs can also be used more like a control sheet to offer multiple buttons if you simply remove the top margin from the dialog's inner container element. For example, if your dialog page had a class of my-dialog, you could add this CSS to pin that dialog to the top: .ui-dialog.my-dialog .ui-dialog-contain { margin-top: 0 }, or you could just apply that style to all dialogs with .ui-dialog .ui-dialog-contain { margin-top: 0 }.

Share photos...

Dialog width and margins

For the sake of readability, dialogs have a default max-width of 500 pixels (plus 15px padding on each side). There is also a 10% top margin to give dialogs larger top margin on larger screens, but collapse to a small margin on smartphones. To override these styles, add the following CSS override rule to your stylesheet and tweak as needed:

.ui-dialog .ui-header, 
.ui-dialog .ui-content, 
.ui-dialog .ui-footer { 
	max-width: 500px; 
	margin: 10% auto 15px auto; 
}
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-dynamic.html jQuery Mobile Docs - Dynamically Injecting Pages

Dynamically Injecting Pages

Home Search

jQuery Mobile and Dynamic Page Generation

jQuery Mobile allows pages to be pulled into the DOM dynamically via its default click hijacking behavior, or through manual calls to $.mobile.changePage(). This is great for applications that generate HTML pages/fragments on the server-side, but there are sometimes cases where an application needs to dynamically generate page content on the client-side from JSON or some other format. This may be necessary for bandwidth/performance reasons, or because it is the data format of choice for the server they are interacting with.

For applications that need to generate page markup on the client-side, it's important to know about the notifications that are triggered during a $.mobile.changePage() call because they can be used as hooks into the navigation system that will allow you to generate your content at the appropriate time.

A call to changePage() will usually trigger the following event notifications:

  • pagebeforechange
    • Fired off before any page loading or transition.
    • NOTE: This event was formerly known as "beforechangepage".
  • pagechange
    • Fired off after all page loading and transitions.
    • NOTE: this event was formerly known as "changepage".
  • pagechangefailed
    • Fired off if an error has occurred while attempting to dynamically load a new page.

These notifications are triggered on the parent container element ($.mobile.pageContainer) of pages, and will bubble all the way up to the document element and window.

For applications wishing to inject pages, or radically modify the content of an existing page, based on some non-HTML data, such as JSON or in-memory JS object, the pagebeforechange event is very useful since it gives you a hook for analyzing the URL or page element the application is being asked to load or switch to, and short-circuit the default changePage() behavior by simply calling preventDefault() on the pagebeforechange event.

To illustrate this technique, take a look at this working sample. In this sample, the main page starts off with a list of categories that the user can navigate into. The actual items in each category are stored in a JavaScript object in memory, for illustrative purposes, but the data can really come from anywhere.


var categoryData = {
	animals: {
		name: "Animals",
		description: "All your favorites from aardvarks to zebras.",
		items: [
			{
				name: "Pets"
			},
			{
				name: "Farm Animals"
			},
			{
				name: "Wild Animals"
			}
		]
	},
	colors: {
		name: "Colors",
		description: "Fresh colors from the magic rainbow.",
		items: [
			{
				name: "Blue"
			},
			{
				name: "Green"
			},
			{
				name: "Orange"
			},
			{
				name: "Purple"
			},
			{
				name: "Red"
			},
			{
				name: "Yellow"
			},
			{
				name: "Violet"
			}
		]
	},
	vehicles: {
		name: "Vehicles",
		description: "Everything from cars to planes.",
		items: [
			{
				name: "Cars"
			},
			{
				name: "Planes"
			},
			{
				name: "Construction"
			}
		]
	}
};

The application uses links with urls that contain a hash that tells the application what category items to display:


  	<h2>Select a Category Below:</h2>
  	<ul data-role="listview" data-inset="true">
    	<li><a href="#category-items?category=animals">Animals</a></li>
    	<li><a href="#category-items?category=colors">Colors</a></li>
    	<li><a href="#category-items?category=vehicles">Vehicles</a></li>
    </ul>

Internally, when the user clicks on one of these links, the application intercepts the internal $.mobile.changePage() call that is invoked by the frameworks' default link hijacking behavior. It then analyzes the URL for the page about to be loaded, and then decides whether or not it should handle the loading itself, or to let the normal changePage() code handle things.

The application was able to insert itself into the changePage() flow by binding to the pagebeforechange event at the document level:


// Listen for any attempts to call changePage().
$(document).bind( "pagebeforechange", function( e, data ) {

	// We only want to handle changePage() calls where the caller is
	// asking us to load a page by URL.
	if ( typeof data.toPage === "string" ) {

		// We are being asked to load a page by URL, but we only
		// want to handle URLs that request the data for a specific
		// category.
		var u = $.mobile.path.parseUrl( data.toPage ),
			re = /^#category-item/;

		if ( u.hash.search(re) !== -1 ) {

			// We're being asked to display the items for a specific category.
			// Call our internal method that builds the content for the category
			// on the fly based on our in-memory category data structure.
			showCategory( u, data.options );

			// Make sure to tell changePage() we've handled this call so it doesn't
			// have to do anything.
			e.preventDefault();
		}
	}
});

So why listen at the document level? In short, because of deep-linking. We need our binding to be active before the jQuery Mobile framework initializes and decides how to process the initial URL that invoked the application.

When the callback for the pagebeforechange binding is invoked, the 2nd argument to the callback will be a data object that contains the arguments that were passed to the initial $.mobile.changePage() call. The properties of this object are as follows:

  • toPage
    • Can be either a jQuery collection object containing the page to be transitioned to, OR a URL reference for a page to be loaded/transitioned to.
  • options
    • Object containing the options that were passed in by the caller of the $.mobile.changePage() function.
    • A list of the options can be found here.

For our sample application, we are only interested in changePage() calls where URLs are initially passed in, so the first thing our callback does is check the type for the toPage. Next, with the help of some URL parsing utilities, it checks to make sure if the URL contains a hash that we are interested in handling ourselves. If so, it then calls an application function called showCategory() which will dynamically create the content for the category specified by the URL hash, and then it calls preventDefault() on the event.

Calling preventDefault() on a pagebeforechange event causes the originating $.mobile.changePage() call to exit without performing any work. Calling the preventDefault() method on the event is the equivalent of telling jQuery Mobile that you have handled the changePage() request yourself.

If preventDefault() is not called, changePage() will continue on processing as it normally does. One thing to point out about the data object that is passed into our callback, is that any changes you make to the toPage property, or options properties, will affect changePage() processing if preventDefault() is not called. So for example, if we wanted to redirect or map a specific URL to another internal/external page, our callback could simply set the data.toPage property in the callback to the URL or DOM element of the page to redirect to. Likewise, we could set, or un-set any option from within our callback, and changePage() would use the new settings.

So now that we know how to intercept changePage() calls, let's take a closer look at how this sample actually generates the markup for a page. Our example actually uses, or we should say, re-uses the same page to display each of the categories. Each time one of our special links is clicked, the function showCategory() gets invoked:


// Load the data for a specific category, based on
// the URL passed in. Generate markup for the items in the
// category, inject it into an embedded page, and then make
// that page the current active page.
function showCategory( urlObj, options )
{
	var categoryName = urlObj.hash.replace( /.*category=/, "" ),

		// Get the object that represents the category we
		// are interested in. Note, that at this point we could
		// instead fire off an ajax request to fetch the data, but
		// for the purposes of this sample, it's already in memory.
		category = categoryData[ categoryName ],

		// The pages we use to display our content are already in
		// the DOM. The id of the page we are going to write our
		// content into is specified in the hash before the '?'.
		pageSelector = urlObj.hash.replace( /\?.*$/, "" );

	if ( category ) {
		// Get the page we are going to dump our content into.
		var $page = $( pageSelector ),

			// Get the header for the page.
			$header = $page.children( ":jqmData(role=header)" ),

			// Get the content area element for the page.
			$content = $page.children( ":jqmData(role=content)" ),

			// The markup we are going to inject into the content
			// area of the page.
			markup = "<p>" + category.description + "</p><ul data-role='listview' data-inset='true'>",

			// The array of items for this category.
			cItems = category.items,

			// The number of items in the category.
			numItems = cItems.length;

		// Generate a list item for each item in the category
		// and add it to our markup.
		for ( var i = 0; i < numItems; i++ ) {
			markup += "<li>" + cItems[i].name + "</li>";
		}
		markup += "</ul>";

		// Find the h1 element in our header and inject the name of
		// the category into it.
		$header.find( "h1" ).html( category.name );

		// Inject the category items markup into the content element.
		$content.html( markup );

		// Pages are lazily enhanced. We call page() on the page
		// element to make sure it is always enhanced before we
		// attempt to enhance the listview markup we just injected.
		// Subsequent calls to page() are ignored since a page/widget
		// can only be enhanced once.
		$page.page();

		// Enhance the listview we just injected.
		$content.find( ":jqmData(role=listview)" ).listview();

		// We don't want the data-url of the page we just modified
		// to be the url that shows up in the browser's location field,
		// so set the dataUrl option to the URL for the category
		// we just loaded.
		options.dataUrl = urlObj.href;

		// Now call changePage() and tell it to switch to
		// the page we just modified.
		$.mobile.changePage( $page, options );
	}
}

In our sample app, the hash of the URL we handle contains 2 parts:


#category-items?category=vehicles

The first part, before the '?' is actually the id of the page to write content into, the part after the '?' is info the app uses to figure out what data it should use when generating the markup for the page. The first thing showCategory() does is deconstruct this hash to extract out the id of the page to write content into, and the name of the category it should use to get the correct set of data from our in-memory JavaScript category object. After it figures out what category data to use, it then generates the markup for the category, and then injects it into the header and content area of the page, wiping out any other markup that previously existed in those elements.

After it injects the markup, it then calls the appropriate jQuery Mobile widget calls to enhance the list markup it just injected. This is what turns the normal list markup into a fully styled listview with all its behaviors.

Once that's done, it then calls $.mobile.changePage(), passing it the DOM element of the page we just modified, to tell the framework that it wants to show that page.

Now an interesting problem here is that jQuery Mobile typically updates the browser's location hash with the URL associated with the page it is showing. Because we are re-using the same page for each category, this wouldn't be ideal, because the URL for that page has no specific category info associated with it. To get around this problem, showCategory() simply sets the dataUrl property on the options object it passes into changePage() to tell it to display our original URL instead.

That's the sample in a nutshell. It should be noted that this particular sample and its usage is not a very good example of an app that degrades gracefully when JavaScript is turned off. That means it probably won't work very well on C-Grade browsers. We will be posting other examples that demonstrate how to degrade gracefully in the future. Check this page for updates.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-links.html jQuery Mobile Docs - Linking Pages

Linking pages

Home Search

Linking pages

jQuery Mobile is designed to work with simple page linking conventions. Essentially, you can link pages and assets as you normally would, and jQuery Mobile will automatically handle page requests in a single-page model, using Ajax when possible. When Ajax isn't possible (such as a non-same-domain url, or if specified using certain attributes on the link), a normal http request is used instead.

The goal of this model is to allow developers to create websites using best practices — where ordinary links will "just work" without any special configuration — while creating a rich, native-like experience that can't be achieved with standard HTTP requests.

Default link behavior: Ajax

To enable animated page transitions, all links that point to an external page (ex. products.html) will be loaded via Ajax. To do this unobtrusively, the framework parses the link's href to formulate an Ajax request (Hijax) and displays the loading spinner. All this happens automatically by jQuery Mobile.

If the Ajax request is successful, the new page content is added to the DOM, all mobile widgets are auto-initialized, then the new page is animated into view with a page transition.

If the Ajax request fails, the framework will display a small error message overlay (styled in the "e" swatch) that disappears after a brief time so this doesn't break the navigation flow. View an example of the error message.

Note: You cannot link to a multipage document with Ajax navigation active because the framework will only load the first page it finds, not the full set of internal pages. In these cases, you must link without Ajax (see next section) for a full page refresh to prevent potential hash collisions. There is currently a subpage plugin that makes it possible to load in multi-page documents.

Linking without Ajax

Links that point to other domains or that have rel="external", data-ajax="false" or target attributes will not be loaded with Ajax. Instead, these links will cause a full page refresh with no animated transition. Both attributes (rel="external" and data-ajax="false") have the same effect, but a different semantic meaning: rel="external" should be used when linking to another site or domain, while data-ajax="false" is useful for simply opting a page within your domain from being loaded via Ajax. Because of security restrictions, the framework always opens links to external domains out of the Ajax behavior.

In version 1.1, we've added support for using data-ajax="false" on a parent container which allows you to excluded a large number of links from the Ajax navigation system. This avoids the need to add this attribute to every link in a container.

Note: When building a jQuery Mobile application where the Ajax navigation system is disabled globally or frequently disabled on individual links, we recommend disabling the $.mobile.pushStateEnabled global configuration option to avoid inconsistent navigation behavior in some browsers.

Linking within a multi-page document

A single HTML document can contain one or many 'page' containers simply by stacking multiple divs with a data-role of "page". This allows you to build a small site or application within a single HTML document; jQuery Mobile will simply display the first 'page' it finds in the source order when the page loads.

If a link in a multi-page document points to an anchor (#foo), the framework will look for a page wrapper with that ID (id="foo"). If it finds a page in the HTML document, it will transition the new page into view. You can seamlessly navigate between local, internal "pages" and external pages in jQuery Mobile. Both will look the same to the end user except that external pages will display the Ajax spinner while loading. In either situation, jQuery Mobile updates the page's URL hash to enable Back button support, deep-linking and bookmarking.

It's important to note that if you are linking from a mobile page that was loaded via Ajax to a page that contains multiple internal pages, you need to add a rel="external" or data-ajax="false" to the link. This tells the framework to do a full page reload to clear out the Ajax hash in the URL. This is critical because Ajax pages use the hash (#) to track the Ajax history, while multiple internal pages use the hash to indicate internal pages so there will be conflicts in the hash between these two modes.

For example, a link to a page containing multiple internal pages would look like this:

<a href="multipage.html" rel="external">Multi-page link</a>

"Back" button links

If you use the attribute data-rel="back" on an anchor, any clicks on that anchor will mimic the back button, going back one history entry and ignoring the anchor's default href. This is particularly useful when generating "back" buttons with JavaScript, such as a button to close a dialog. When using this feature in your source markup, although browsers that support this feature will not use the specified href attribute, be sure to still provide a meaningful value that actually points to the URL of the referring page to allow the feature to work for users in C-Grade browsers. If users can reach this page from more than one referring pages, specify a sensible href so that the navigation remains logical for all users. Also, please keep in mind that if you just want a reverse transition without actually going back in history, you should use the data-direction="reverse" attribute instead. Note: data-direction="reverse" is meant to simply run the backwards version of the transition that will run on that page change, while data-rel="back" makes the link functionally equivalent to the browser's back button and all the standard back button logic applies. Adding data-direction="reverse" to a link with data-rel="back" will not reverse the reversed page transition and produce the "normal" version of the transition.

Redirects and linking to directories

When linking to directory indexes (such as href="typesofcats/" instead of href="typesofcats/index.html"), you must provide a trailing slash. This is because jQuery Mobile assumes the section after the last "/" character in a url is a filename, and it will remove that section when creating base urls from which future pages will be referenced.

However, you can work around this issue by returning your page div with a data-url attribute already specified. When you do this, jQuery Mobile will use that attribute's value for updating the URL, instead of the url used to request that page. This also allows you to return urls that change as the result of a redirect, for example, you might post a form to "/login.html" but return a page from the url "/account" after a successful submission. This tool allows you to take control of the jQuery Mobile history stack in these situations. Here's an example:

The following link points to "docs-links-urltest/index.html": Test Link which is a directory with an index page. The return page will update the hash as "/docs/pages/docs-links-urltest/" with a trailing slash. This is done via the data-url attribute in that page's source. Keep in mind that the value will replace the entire hash, and it is up to you to replace it with a URL that actually resolves to the correct page when requested via refresh or deep link.

Learn more about the technical details of the navigation model and Ajax, hashes and history in jQuery mobile.

Link examples

All standard HTML link types are supported in jQuery Mobile in addition to the types outlined above. Here is a sampler of many common link types:

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-navmodel.html jQuery Mobile Docs - Ajax, hashes & history

Ajax, hashes & history

Home Search

jQuery Mobile's navigation model

A "page" in jQuery Mobile consists of an element (usually a div) with a data-role attribute set to "page", which generally contains div elements with roles of "header", "content", and "footer", each containing common markup, forms, and custom jQuery Mobile widgets.

The basic workflow with page loading is as follows: first, a page is requested with a normal HTTP request, and subsequent "pages" are then requested and injected into that page's DOM. Because of this, the DOM may have a number of "pages" in it at a time, each of which can be re-visited by linking to its data-url attribute.

When a url is initially requested, there may be one or more "pages" in the response, and only the first one will be shown. The advantage of storing more than one "page" is that it allows you to pre-fetch static pages that are likely to be visited.

Hash and Ajax driven page navigation

By default all navigation within jQuery Mobile is based on changes and updates to location.hash. Whenever possible, page changes will use a smooth transition between the current "page" and the next, whether it is either already present in the DOM, or is automatically loaded via Ajax.

Hash values created by jQuery Mobile are normalized as full paths relative to the URL of the first "real" page that was loaded. The hash is always maintained as a valid URL, so any "page" in jQuery mobile can be bookmarked or referenced in a link. To retrieve a non-hash-based URL, simply remove the # from the address and refresh the page.

In general, hash changes are created whenever a link is clicked in jQuery mobile. When a link is clicked, jQuery mobile will make sure that the link is referencing a local URL, and if so, it'll prevent the link's default click behavior from occurring and request the referenced url via Ajax instead. When the page returns successfully, it will set the location.hash to the new page's relative url.

Hash changes that occur independently of a click, such as when a user clicks the back button, are handled through the hashchange event, which is bound to the window object using Ben Alman's hashchange special event plugin (included in jQuery Mobile). When a hash change occurs (and also when the first page loads), the hashchange event handler will send the location.hash to the $.mobile.changePage() function, which in turn either loads or reveals the referenced page.

Once the referenced page is present in the DOM, the $.mobile.changePage() function applies a transition between the current active page and the new page. Page transitions happen through adding and removing classes that apply CSS animations. For example, in a slide-left transition, the exiting page is given the classes "slideleft" and "out", and the entering page is given the classes "slideleft" and "in", as well as a class of "ui-page-active" to mark it as the new "active" page being viewed. When the animation is complete, the "in" and "out" classes are removed, and the exited page loses its "ui-page-active" class.

pushState plugin

There is an optional feature that converts the longer, hash-based URLs mentioned in the previous section into the full document path which is cleaner and makes the Ajax tracking transparent in the URL structure. This is built as an enhancement on top of the hash-based URL system for Ajax links. Note that despite the name, this feature technically converts hash-based urls by using history.replaceState (not history.pushState) in the current release because this works more reliably across our target platforms. For browsers that do not support history.replaceState, or if this feature is disabled, hash-based URLs will be used instead.

Since the plugin initializes when the DOM is fully loaded you can enable and disable it manually by setting $.mobile.pushStateEnabled global configuration option to false anytime before document ready.

Important: rel="external" and $.mobile.ajaxEnabled=false

Slightly different implementations of the replaceState API in various browsers can cause odd behavior in specific scenarios. For example, some browser implementations (including desktop browsers) implement the popstate event differently when linking externally and moving back to a page onto which state has already been pushed/replaced. When building a jQuery Mobile application where the ajax navigation is being explicitly disabled, either through the frequent use of rel="external" on links or by disabling Ajax navigation completely via the $.mobile.ajaxEnabled=false, we recommend disabling the pushState feature to fall back to the hash based navigation for more consistent behavior.

changePage

Within the framework, page changes - both for pages already in the DOM and for pages that need to be loaded via Ajax - use the $.mobile.changePage() function. $.mobile.changePage() contains all of the logic for finding pages to transition to and from, and how to handle various response conditions such as a page not found. $.mobile.changePage() can be called externally and accepts the following arguments (to, transition, back, changeHash). The to argument can accept either a string (such as a file url or local element's ID), an array (in which the first array item is any local page you'd like to transition from, and the second array item is the to page), or an object (with expected properties: url, type ("get" or "post"), and data (for serialized parameters)), the latter of which is useful for loading pages that expect form data. The transition argument accepts a string representing a named transition, such as "slide". The back argument accepts a boolean representing whether the transition should go forward or in reverse. Lastly, the changeHash argument accepts a boolean for whether you'd like the url to be updated upon a successful page change.

The $.mobile.changePage() function is used in a number of places in jQuery Mobile. For example, when a link is clicked, its href attribute is normalized and then $.mobile.changePage() handles the rest. When forms are submitted, jQuery Mobile simply gathers a few of the form's attributes, serializes its data, and once again, $.mobile.changePage() is used to handle the submission and response. Also, links that create dialogs use $.mobile.changePage()to open a referenced page without updating the hash, which is useful for keeping dialogs out of history tracking.

Base element

Another key ingredient to jQuery Mobile's page navigation model is the base element, which is injected into the head and modified on every page change to ensure that any assets (images, CSS, JS, etc.) referenced on that page will be requested from a proper path. In browsers that don't support dynamic updates to the base element (such as Firefox 3.6), jQuery Mobile loops through all of the referenced assets on the page and prefixes their href and src attributes with the base path.

Developer explanation of base url management:

jQuery Mobile manages http requests using a combination of generated absolute URL paths and manipulating a generated <base> element's href attribute. The combination of these two approaches allows us to create URLs that contain full path information for loading pages, and a base element to properly direct asset requests made by those loaded pages (such as images and stylesheets).

TODO: update description of internal base and urlHistory objects

Data-url storage

The navigation model maintains a data-url attribute on all data-role="page" elements. This data-url attribute is used to track the origin of the page element. Pages embedded within the main application document all have their data-url parameter set to the ID of their element with data-role="page". The only exception to this is the first-page in the document. The first-page is special because it can be addressed by its id if it has one, or by the document or base URL (with no hash fragment).

Pages that are external to the application document get pulled in dynamically via ajax, and their data-url is set to the site relative path to the external page. If you are running in an environment where loading an external page from a different domain is allowed, then the data-url is set to the absolute URL.

Auto-generated pages and sub-hash urls

Some plugins may choose to dynamically break a page's content into separate navigable pages, which can then be reached via deep links. One example of this would be the Listview plugin, which will break a nested UL (or OL) into separate pages, which are each given a data-url attribute so they can be linked to like any normal "page" in jQuery Mobile. However, in order to link to these pages, the page that generates them must first be requested from the server. To make this work, pages that are auto-generated by plugins use the following special data-url structure: <div data-url="page.html&subpageidentifier">

So, for example, a page generated by the listview plugin may have a data-url attribute like this: data-url="artists.html&ui-page=listview-1"

When a page is requested, jQuery Mobile knows to split the URL at "&ui-page" and make an HTTP request to the portion of the URL before that key. In the case of the listview example mentioned above, the URL would look like this: http://example.com/artists.html&ui-page=listview-1 ...and jQuery Mobile would request artists.html, which would then generate its sub-pages, creating the div with data-url="artists.html&ui-page=listview-1", which it will then display as the active page.

Note that the data-url attribute of the element contains the full URL path, not just the portion after &ui-page=. This allows jQuery Mobile to use a single consistent mechanism that matches URLs to page data-url attributes.

Cases when Ajax navigation will not be used

Under certain conditions, normal http requests will be used instead of Ajax requests. One case where this is true is when linking to pages on external websites. You can also specify that a normal http request be made through the following link attributes:

  • rel=external

  • target (with any value, such as "_blank")

Form submissions

Form submissions are handled automatically through the navigation model as well. Visit the forms section for more information.

Using the Application Cache

When using the application cache with jQuery Mobile there is at least one important issue to consider. Some browsers, when making requests to the cache will report an http status of 0 on success. This causes jQuery Core's $.ajax to trigger error handlers. The suggested workaround for users leveraging the application cache is to use a jQuery ajax pre-filter. Something like the following (credit to jammus for the snippet):



$.ajaxPrefilter( function(options, originalOptions, jqXHR) {
	if ( applicationCache &&
		 applicationCache.status != applicationCache.UNCACHED &&
		 applicationCache.status != applicationCache.OBSOLETE ) {
		 // the important bit
		 options.isLocal = true;
	}
});

			

Setting isLocal to true for your ajax requests will alert jQuery Core that it should handle the 0 return values differently. Local requests exhibit similar behavior (ie 0 statuses), and Core will then fall back to determining success based on the presence of content in the xhr responseText attribute.

One important issue to note with the above is that it will set isLocal to true for all requests made via ajax regardless of whether they are in the manifest or not so long as the cache is valid. This works for now because Core only consults the isLocal value when the status is in fact 0 which doesn't affect uncached results. There is no long term guarantee that isLocal will remain isolated in its purpose for handling 0 status values. If that changes it may break your application.

Known limitations

The non-standard environment created by jQuery Mobile's page navigation model introduces some conditions of which you should be aware when building pages:

  • When linking to directories, without a filename url, (such as href="typesofcats/" instead of href="typesofcats/index.html"), you must provide a trailing slash. This is because jQuery Mobile assumes the section after the last "/" character in a url is a filename, and it will remove that section when creating base urls from which future pages will be referenced.

  • Documents loaded via Ajax will select the first page in the DOM of that document to be loaded as a JQM page element. As a result the developer must make sure to manage the ID attributes of the loaded page and child elements to prevent confusion when manipulating the DOM.

  • If you link to multipage document, you must use a data-ajax="false" attribute on the link to cause a full page refresh due to the limitation above where we only load the first page node in an Ajax request due to potential hash collisions. There is currently a subpage plugin that makes it possible to load in multi-page documents.

  • Any unique assets referenced by pages in a jQuery Mobile-driven site should be placed inside the "page" element (the element with a data-role attribute of "page"). For example, links to styles and scripts that are specific to a particular page can be referenced inside that div. However, a better approach is to use jQuery Mobile's page events to trigger specific scripting when certain pages load. Note: you can return a page from the server with a data-url already specified in the markup, and jQuery Mobile will use that for the hash update. This allows you to ensure directory paths resolve with a trailing slash and will therefore be used in the base url path for future requests.

  • Conversely, any non-unique assets (those used site-wide) should be referenced in the <head> section of an HTML document, or at the very least, outside of the "page" element, to prevent running scripts more than once.

  • The "ui-page" key name used in sub-hash url references can be set to any value you'd like, so as to blend into your URL structure. This value is stored in jQuery.mobile.subPageUrlKey.

  • When traveling back to a previously loaded jQuery Mobile document from an external or internal document with the push state plugin enabled, some browsers load and trigger the popstate event on the wrong document or for the wrong reasons (two edge cases recorded so far). If you are regularly linking to external documents and find the application behaving erratically try disabling pushstate support.

  • jQuery Mobile does not support query parameter passing to internal/embedded pages but there are two plugins that you can add to your project to support this feature. There is a lightweight page params plugin and a more fully featured jQuery Mobile router plugin for use with backbone.js or spine.js.

  • Since we use the URL hash to preserve Back button behavior, using page anchors to jump down to a position on the page isn't supported by using the traditional anchor link (#foo). Use the silentScroll method to scroll to a particular Y position without triggering scroll event listeners. You can pass in a yPos arguments to scroll to that Y location.

  • Some external applications (notably Facebook's OAuth implementation) modify their response URL in such a way that interferes with jQuery Mobile. In particular, Facebook appends #_=_ to the end of the callback. Currently the best solution for this is to remove it from the location hash before jQuery Mobile loads using something like: if (window.location.hash == "#_=_") window.location.hash = ""; . jQuery Mobile can then process & enhance the page properly.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-scripting.html jQuery Mobile Docs - Scripting pages

Scripting pages

Home Search

Scripting pages in jQuery Mobile

Since jQuery Mobile uses an Ajax-powered navigation system, there are a few helpful things to know when writing scripts that manipulate your content. You can explore the mobile API in more detail by reading up on global configuration options, events, and methods or dig into the technical details of the Ajax navigation model.

Scripts & styles in the head

When the user clicks a link in a jQuery Mobile-driven site, the default behavior of the navigation system is to use that link's href to formulate an Ajax request (instead of allowing the browser's default link behavior of requesting that href with full page load). When that Ajax request goes out, the framework will receive its entire text content, but it will only inject the contents of the response's body element (or more specifically the data-role="page" element, if it's provided), meaning nothing in the head of the page will be used (with the exception of the page title, which is fetched specifically). Please note that script's loaded dynamically in this fashion do not guarantee a load order in the same way they would if the page was loaded via a normal http request.

This means that any scripts and styles referenced the head of a page won't have any effect when a page is loaded via Ajax, but they will execute if the page is requested normally via HTTP. When scripting jQuery Mobile sites, both scenarios need to be considered. The reason that the head of a page is ignored when requested via Ajax is that the potential of re-executing the same JavaScript is very high (it's common to reference the same scripts in every page of a site). Due to the complexity of attempting to work around that issue, we leave the task of executing page-specific scripts to the developer, and assume head scripts are only expected to execute once per browsing session.

The simplest approach when building a jQuery Mobile site is to reference the same set of stylesheets and scripts in the head of every page. If you need to load in specific scripts or styles for a particular page, we recommend binding logic to the pageInit event (details below) to run necessary code when a specific page is created (which can be determined by its id attribute, or a number of other ways). Following this approach will ensure that the code executes if the page is loaded directly or is pulled in and shown via Ajax.

Another approach for page-specific scripting would be to include scripts at the end of the body element when no data-role=page element is defined, or inside the first data-role=page element. If you include your custom scripting this way, be aware that these scripts will execute when that page is loaded via Ajax or regular HTTP, so if these scripts are the same on every page, you'll likely run into problems. If you're including scripts this way, we'd recommend enclosing your page content in a data-role="page" element, and placing scripts that are referenced on every page outside of that element. Scripts that are unique to that page can be placed in that element, to ensure that they execute when the page is fetched via Ajax.

pageinit = DOM ready

One of the first things people learn in jQuery is to use the $(document).ready() function for executing DOM-specific code as soon as the DOM is ready (which often occurs long before the onload event). However, in jQuery Mobile site and apps, pages are requested and injected into the same DOM as the user navigates, so the DOM ready event is not as useful, as it only executes for the first page. To execute code whenever a new page is loaded and created in jQuery Mobile, you can bind to the pageinit event.

The pageinit event is triggered on a page when it is initialized, right after initialization occurs. Most of jQuery Mobile's official widgets auto-initialize themselves based on this event, and you can set up your code to do the same.


$( document ).delegate("#aboutPage", "pageinit", function() {
  alert('A page with an ID of "aboutPage" was just created by jQuery Mobile!');
});

If you'd like to manipulate a page's contents before the pageinit event fires and widgets are auto-initialized, you can instead bind to the pagebeforecreate event:


$( document ).delegate("#aboutPage", "pagebeforecreate", function() {
  alert('A page with an ID of "aboutPage" is about to be created by jQuery Mobile!');
});

Important note: pageCreate() vs pageInit()

Prior to Beta 2 the recommendation to users wishing to manipulate jQuery Mobile enhanced page and child widget markup was to bind to the pagecreate event. In Beta 2 an internal change was made to decouple each of the widgets by binding to the pagecreate event in place of direct calls to the widget methods. As a result, users binding to the pagecreate in mobileinit would find their binding executing before the markup had been enhanced by each of the plugins. In keeping with the lifecycle of the jQuery UI Widget Factory, the initialization method is invoked after the create method, so the pageinit event provides the correct timing for post enhancement manipulation of the DOM and/or Javascript objects. In short, if you were previously using pagecreate to manipulate the enhanced markup before the page was shown, it's very likely you'll want to migrate to 'pageinit'.

Changing pages

If you want to change the current active page with JavaScript, you can use the changePage method. There are a lot of methods and properties that you can set when changing pages, but here are two simple examples:


//transition to the "about us" page with a slideup transition
$.mobile.changePage( "about/us.html", { transition: "slideup"} );

//transition to the "search results" page, using data from a form with an ID of "search"
$.mobile.changePage( "searchresults.php", {
	type: "post",
	data: $("form#search").serialize()
});

Loading pages

To load an external page, enhance its content, and insert it into the DOM, use the loadPage method. There are a lot of methods and properties that you can set when loading pages, but here is a simple example:


//load the "about us" page into the DOM
$.mobile.loadPage( "about/us.html" );

Enhancing new markup

The page plugin dispatches a pageInit event, which most widgets use to auto-initialize themselves. As long as a widget plugin script is referenced, it will automatically enhance any instances of the widgets it finds on the page.

However, if you generate new markup client-side or load in content via Ajax and inject it into a page, you can trigger the create event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (listview button, select, etc.).

For example, if a block of HTML markup (say a login form) was loaded in through Ajax, trigger the create event to automatically transform all the widgets it contains (inputs and buttons in this case) into the enhanced versions. The code for this scenario would be:

$( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" );

Create vs. refresh: An important distinction

Note that there is an important difference between the create event and refresh method that some widgets have. The create event is suited for enhancing raw markup that contains one or more widgets. The refresh method should be used on existing (already enhanced) widgets that have been manipulated programmatically and need the UI be updated to match.

For example, if you had a page where you dynamically appended a new unordered list with data-role=listview attribute after page creation, triggering create on a parent element of that list would transform it into a listview styled widget. If more list items were then programmatically added, calling the listview’s refresh method would update just those new list items to the enhanced state and leave the existing list items untouched.

data-enhance="false" data attribute

As of jQuery Mobile 1.0, all the markup within a page is scanned for elements to be enhanced. This is problematic for 3rd party widgets/libraries that don’t want anybody enhancing their markup or attaching behavior. We heard requests for a data-* attribute that can be placed on an element container to tell the framework not to enhance anything inside it for these situations. In 1.1, we’ve added a new data-enhance="false" attribute that can be added to a container to prevent both auto-initialization and link/form hijacking. This is also available via $.fn.jqmEnhanceable. It’s important to note that because of the performance impact incurred by finding a parent element with the data-enhance="false" attribute this feature must be turned on explicitly with $.mobile.ignoreContentEnabled=true.

data-ajax="false" now works on containers

On a related topic, we’ve always offered the ability to disable the AJAX navigation system from hijacking a link or form submit via the data-ajax="false" attribute, but people have asked for a way to apply this exclusion more efficiently to a grouping of links. In 1.1, this is now possible by simply adding, and setting $.mobile.ignoreContentEnabled=true, the data-ajax attribute to a parent container and it will exclude all the child links or forms from the AJAX navigation system behavior.

Scrolling to a position within a page

Since we use the URL hash to preserve Back button behavior, using page anchors to jump down to a position on the page isn't supported by using the traditional anchor link (#foo). Use the silentScroll method to scroll to a particular Y position without triggering scroll event listeners. You can pass in a yPos argument to scroll to that Y location. For example:


//scroll to Y 300px
$.mobile.silentScroll(300);

Binding to mouse and touch events

One important consideration in mobile is handling mouse and touch events. These events differ significantly across mobile platforms, but the common denominator is that click events will work everywhere, but usually after a significant delay of 500-700ms. This delay is necessary for the browser to wait for double tap, scroll and extended hold tap events to potentially occur. To avoid this delay, it's possible to bind to touch events (ex. touchstart) but the issue with this approach is that some mobile platforms (WP7, Blackberry) don't support touch. To compound this issue, some platforms will emit both touch and mouse events so if you bind to both types, duplicate events will be fired for a single interaction.

Our solution is to create a set of virtual events that normalize mouse and touch events. This allows the developer to register listeners for the basic mouse events, such as mousedown, mousemove, mouseup, and click, and the plugin will take care of registering the correct listeners behind the scenes to invoke the listener at the fastest possible time for that device. This still retains the order of event firing in the traditional mouse environment, should multiple handlers be registered on the same element for different events. The virtual mouse system exposes the following virtual events to jQuery bind methods: vmouseover, vmousedown, vmousemove, vmouseup, vclick, and vmousecancel

Passing parameters between pages

jQuery Mobile does not support query parameter passing to internal/embedded pages. For example, if the framework sees a link to "#somePage?someId=1" it interpret that as "#somePage" and navigate to the internal page div with an ID of somePage and apply a data-url of #somePage?someId=1 to that page container. Subsequent calls to other params such as "#somePage?someId=2" will find the same div because jQuery Mobile refers to the data-url on the div which is only set once and will remain at #somePage?someId=1.

There are two plugins that you can add to your project if query parameters are needed between pages. There is a lightweight page params plugin and a more fully featured jQuery Mobile router plugin for use with backbone.js or spine.js.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-template.html Single page template

Single page

This is a single page boilerplate template that you can copy to build your first jQuery Mobile page. Each link or form from here will pull a new page in via Ajax to support the animated page transitions.

Just view the source and copy the code to get started. All the CSS and JS is linked to the jQuery CDN versions so this is super easy to set up. Remember to include a meta viewport tag in the head to set the zoom level.

This template is standard HTML document with a single "page" container inside, unlike a multi-page template that has multiple pages within it. We strongly recommend building your site or app as a series of separate pages like this because it's cleaner, more lightweight and works better without JavaScript.

Footer content

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-titles.html jQuery Mobile Docs - Page titles

Page titles

Home Search

Titles in Ajax navigation

When you load the first page of a jQuery Mobile based site, then click a link or submit a form, Ajax is used to pull in the content of the requested page. Having both pages in the DOM is essential to enable the animated page transitions, but one downside of this approach is that the page title is always that of the first page, not the subsequent page you’re viewing.

To remedy this, jQuery Mobile automatically parses the title of the page pulled via Ajax and changes the title attribute of the parent document to match.

Titles in multi-page templates

On multi-page documents, we follow a similiar convention, but since all the pages share a common title, we have a data-title attribute that can be added to each page container within a multi-page template to manually define a title. The title of the HTML document will be automatically updated to match the data-title of the page currently in view.


<div data-role="page" id="foo" data-title="Page Foo">

</div><!-- /page -->
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-transitions-dialog.html jQuery Mobile Framework - Dialog

Dialog

That was an animated page transition effect to a dialog that we added with a data-transition attribute on the link.

Since it uses CSS animations, this should be hardware accelerated on many devices. To see transitions, 3D transform support is required so if you only saw a fade transition that's the reason.

Take me back
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-transitions-flash-workaround.html jQuery Mobile Docs - Transitions

Transitions

Home Search

Page transitions with workaround

The jQuery Mobile framework includes a set of CSS-based transition effects that can be applied to any page link or form submission with Ajax navigation:

fade

dialog page

pop

dialog page

flip

dialog page

turn

dialog page

flow

dialog page

slidefade

dialog page

slide

dialog page

slideup

dialog page

slidedown

dialog page

none

dialog page
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-transitions-page.html jQuery Mobile Framework - Page

Page

That was an animated page transition effect to a page that we added with a data-transition attribute on the link. This uses a different background theme swatch to see how that looks with the transitions.

Since it uses CSS animations, this should be hardware accelerated on many devices. To see transitions, 3D transform support is required so if you only saw a fade transition that's the reason.

Here's a few form elements

These are here to see if this slows down rendering.

Take me back
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\page-transitions.html jQuery Mobile Docs - Transitions

Transitions

Home Search

Page transitions

The jQuery Mobile framework includes a set of CSS-based transition effects that can be applied to any page link or form submission with Ajax navigation:

fade

dialog page

pop

dialog page

flip

dialog page

turn

dialog page

flow

dialog page

slidefade

dialog page

slide

dialog page

slideup

dialog page

slidedown

dialog page

none

dialog page

Important: Some platforms currently have issues with transitions. We are working on a solution to solve the problem for everyone. If you are experiencing flickers and flashes during or at the end of a transition we suggest the following workaround. Please note that this workaround should be throughly tested on the target platform before deployment. This workaround is known to cause performance issues, and browser crashes on some platforms especially Android. Add the following code to your custom css.

.ui-page { -webkit-backface-visibility: hidden; }

This page has the implemented workaround. Please test throughly.

Only seeing fade transitions? To view all transition types, you must be on a browser that supports 3D transforms. By default, devices that lack 3D support (such as Android 2.x) will fallback to "fade" for all transition types. This behavior is configurable (see below).

Transitions were originally inspired by jQtouch They've since been rebuilt, but props to David Kaneda and Jonathan Stark for the initial guidance.

Setting a transition on a link or form submit

By default, the framework applies a fade transition. To set a custom transition effect, add the data-transition attribute to the link.

<a href="index.html" data-transition="pop">I'll pop</a>

When the Back button is pressed, the framework will automatically apply the reverse version of the transition that was used to show the page. To specify that the reverse version of a transition should be used, add the data-direction="reverse" attribute to a link.

Global configuration of transitions

Set the defaultPageTransition global option if you'd prefer a different default transition. Dialogs have a different option called defaultDialogTransition that can also be configured.

Browser support and performance

All transitions are built with CSS keyframe animations and include both -webkit vendor prefixed rules for iOS, Blackberry, Android, Safari and Chrome browsers and -moz rules for Firefox browsers. Support for keyframe animations and transition smoothness is determined by the browser version and hardware and will safely fall back to no transition if animations aren't supported. To proactively exclude transition in situations with poor performance, we exclude browsers that lack 3D transforms and provide a fallback transition and apply a max width for when transitions are applied.

Defining fallback transitions for non-3D support

By default, all transitions except fade require 3D transform support. Devices that lack 3D support will fall back to a fade transition, regardless of the transition specified. We do this to proactively exclude poorly-performing platforms like Android 2.x from advanced transitions and ensure they still have a smooth experience. Note that there are platforms such as Android 3.0 that technically support 3D transforms, but still have poor animation performance so this won't guarantee that every browser will be 100% flicker-free but we try to target this responsibly.

The fallback transition for browsers that don't support 3D transforms can be configured for each transition type, but by default we specify "fade" as the fallback. For example, this will set the fallback transition for the slideout transition to "none":

$.mobile.transitionFallbacks.slideout = "none"

Setting a max scroll for transitions

By default, transitions are disabled (set to "none") when you’re either coming FROM or going TO a page where the scroll position is 3x the height of the device’s screen. This feature was added because of the slow response times and the possibility of browser crashing when clicking on a list item (or any navigation element) far down a long page which leads to the browser trying to animate a really massively tall page from the scroll position to the top of the screen. The scroll position, not total screen height, is the determining factor for performance. This scroll position breakpoint is configurable via the new getMaxScrollForTransition function.

Setting a max width for transitions

By default, transitions can be disabled (set to "none") when the window width is greater than a certain pixel width. This feature is useful because transitions can be distracting or perform poorly on larger screens. This value is configurable via the global option $.mobile.maxTransitionWidth, which defaults to false. The option accepts any number representing a pixel width or false value. If it's not false, the handler will use a "none" transition when the window width is wider than the specified value.

Creating custom transitions

jQuery Mobile allows for the addition of custom transitions to the $.mobile.transitionHandlers dictionary so you can expand the selection of transitions on your site or app.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes.html jQuery Mobile Docs - Theming Pages

Theming pages

Home Search

Page Theming

jQuery Mobile has a rich theming system that gives you full control of how pages are styled. There is detailed theming documentation within each page widget, but let's look at a few high-level examples of how theming is applied.

The data-theme attribute can be applied to the header and footer containers to apply any of the lettered theme color swatches. While the data-theme attribute could be added to the content container, we recommend adding it instead to div or container that has been assigned the data-role="page" attribute to ensure that the background color is applied to the full page. When this is done, all widgets on the page will also inherit the theme specified in the page container. However, headers and footers will default to theme "a". If you want to have a page with, for example, only theme "b" for all its elements, including its header and footer, you will need to specify data-theme="b" to the page div as well as the header and footer divs.

The default Theme mixes styles from multiple swatches to create visual texture and present the various elements in optimal contrast to one another:

Default Theme

Default Theme Content Header

This is the default content color swatch and a preview of a link.

Button

And each of the five "swatches" applies its style consistently across all page elements, as shown below:

Swatch A

Header A

Header

This is content color swatch "A" and a preview of a link.

Button

Swatch B

Header B

Header

This is content color swatch "B" and a preview of a link.

Button

Swatch C

Header C

Header

This is content color swatch "C" and a preview of a link.

Button

Swatch D

Header D

Header

This is content color swatch "D" and a preview of a link.

Button

Swatch E

Header E

Header

This is content color swatch "E" and a preview of a link.

Button
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\phonegap.html jQuery Mobile Docs - Phonegap

PhoneGap apps

Home Search

Building PhoneGap apps with jQuery Mobile

PhoneGap is an HTML5 app platform that allows developers to author native applications with web technologies and get access to APIs and app stores. Applications are built as normal HTML pages and packaged up to run as a native application within a UIWebView or WebView (a chromeless browser, referred to hereafter as a webview). Since PhoneGap is frequently used in conjunction with jQuery Mobile, we wanted to offer a few tips and recommendations to help you get started.

The initial application document is loaded by the PhoneGap application by a local file:// URL. This means that if you want to pull in pages from your company's remote server (phone home) you will have to refer to them with absolute URLs to your server. Because your document originates from a file:// URL, loading pages or assets from your remote server is considered a cross-domain request that can be blocked in certain scenarios.

Your ability to access cross-domain pages from within a Phone Gap jQuery Mobile application is controlled by two key things: $.support.cors and $.mobile.allowCrossDomainPages, and can also be influenced by the white list feature in later builds of PhoneGap.

$.support.cors

In jQuery core, there is a $.support.cors boolean that indicates whether or not jQuery thinks the browser supports the W3C "Cross-Origin Resource Sharing" feature to support cross-domain requests.

Since jQuery Mobile relies on jQuery core's $.ajax() functionality, $.support.cors must be set to true to tell $.ajax to load cross-domain pages. We've heard reports that webviews on some platforms, like BlackBerry, support cross-domain loading, but that jQuery core incorrectly sets $.support.cors value to false which disables cross-domain $.ajax() requests and will cause the page or assets to fail to load.

$.mobile.buttonMarkup.hoverDelay

If you find that the button down/hover state (lists, buttons, links etc) feels sluggish the $.mobile.buttonMarkup.hoverDelay setting might be of use. It will decrease the time between the touch event and the application of the relevant class but will also result in a higher chance that the same class will be applied even when the user is scrolling (eg, over a long list of links).

$.mobile.allowCrossDomainPages

When jQuery Mobile attempts to load an external page, the request runs through $.mobile.loadPage(). This will only allow cross-domain requests if the $.mobile.allowCrossDomainPages configuration option is set to true. Because the jQuery Mobile framework tracks what page is being viewed within the browser's location hash, it is possible for a cross-site scripting (XSS) attack to occur if the XSS code in question can manipulate the hash and set it to a cross-domain URL of its choice. This is the main reason that the default setting for $.mobile.allowCrossDomainPages is set to false.

So in PhoneGap apps that must "phone home" by loading assets off a remote server, both the $.support.cors AND $.mobile.allowCrossDomainPages must be set to true. The $.mobile.allowCrossDomainPages option must be set before any cross-domain request is made so we recommend wrapping this in a mobileinit handler:

$( document ).bind( "mobileinit", function() {
    // Make your jQuery Mobile framework configuration changes here!

    $.mobile.allowCrossDomainPages = true;
});

PhoneGap White Listing

PhoneGap 1.0 introduced the idea of white-listing servers that its internal webview is allowed to make cross-domain requests to. You can find info about it here on the PhoneGap wiki:

However, not all platforms support this white-listing feature so check the PhoneGap documentation for details. Older versions of PhoneGap prior to 1.0 defaulted to allowing cross-domain requests to any server.

Still having issues?

Here are a few more tips that aren't specifically related to PhoneGap but are good to know:

We recommend disabling the pushState feature for installed apps because there are edge cases where this feature can cause unexpected navigation behavior and since URLs aren't visible in a webview, it's not worth keeping this active in these situations.

Android enforces a timeout when loading URLs in a webview which may be too short for your needs. You can change this timeout by editing a Java class generated by the Eclipse plugin for Android:

super.setIntegerProperty("loadUrlTimeoutValue", 60000);

Building UIWebView apps with jQuery Mobile

It's important to note that when creating a custom, non-phonegap, UIWebView control in an iOS application you must use the loadRequest method in preference to loadData for back button support. The snippet below is an example of loading default.html in your view controller.

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSString *fullURL = [[NSBundle mainBundle] pathForResource:@"dialog" ofType:@"html"];
    NSURL *url = [NSURL fileURLWithPath:fullURL];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [webView loadRequest:requestObj];
}
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\touchoverflow.html jQuery Mobile Docs - touchOverflow

touchOverflow

Home Search

touchOverflowEnabled: Deprecated in 1.1.0

Prior to jQuery Mobile 1.1, true fixed toolbar support was contingent on native browser support for the CSS property overflow-scrolling: touch, which is currently only supported in iOS5. As of version 1.1, jQuery Mobile no longer uses this CSS property at all. We've removed all internal usage of this property in the framework, but we've left it defined globally on the $.mobile object to reduce the risk that its removal will cause trouble with existing applications. This property is flagged for removal, so please update your code to no longer use it. The support test for this property, however, remains defined under $.support and we have no plans to remove that test at this time.

touchOverflow: Improved page transitions and true fixed toolbars

Currently, both the page you're viewing and the one you're navigating to are sitting next to each other in the viewport, which lets us leverage native scrolling for the broadest possible device support. The downside to this approach is that since both pages share the same viewport, when a page transition starts, we must first scroll to the top of the document, then start animating to ensure that the pages are lined up vertically. If you hit the Back button, we need to scroll up, transition, then restore the previous scroll position. Since mobile browsers are pretty slow, these scroll movements can detract from the flow of the experience.

The way to really improve this situation is to have both pages in separate containers, each with its own internal scroll bar. The means no more scrolling the document or needing to restore scroll positions for a smoother experience. It also has the benefit of making fixed toolbars very easy to implement by simply placing them outside the containers with internal scrolling.

How it works

To leverage iOS5′s support for a touch-targeted version of overflow:auto which allows for internal scrolling regions with the native momentum scrolling, we've added a feature called touchOverflow that leverages these new CSS capabilities to enable us to bring both true “fixed” toolbars and super smooth transitions to iOS5, all by using web standards and very little additional code.

A feature called touchOverflowEnabled is designed to leverage the upcoming wave of browsers that support overflow scrolling in CSS. Note that this feature is off by default to give us more time to test and debug this for best performance but we hope to turn it on by default at a later point. Here's how to enable this global option:

<script>
$(document).bind("mobileinit", function(){
  $.mobile.touchOverflowEnabled = true;
});
</script>

When this feature is activated, the framework looks for browser support for both the overflow: and -webkit-overflow-scrolling:touch CSS properties. In browsers that support both, it switches to a dual page container model with native overflow: scrolling within each, which brings true fixed toolbars smooth transitions. Coupled with iOS’s already excellent hardware-accelerated transitions, it's now possible to build interfaces that are very close to native performance.

To demo this feature, check out this page in iOS5.

A few downsides

Nothing is perfect, especially a new feature, so there are a few downsides to keep in mind. When activating this feature:

  • Sometimes child elements like lists and forms wouldn't render when embedded in a page with overflow: in iOS5. This was a pretty random phenomenon but is not acceptable so we've added a translate-z CSS property which forces iOS to render the contents. The downside with this fix is that when a transform is applied, all elements are set to position:relative which can cause issues in your layout.
  • The -webkit-overflow-scrolling:touch property seems to disable the events to scroll you to the top of the page when the time is tapped in the status bar. We hope Apple fixes this because it's a very useful feature.
  • When overflow: and -webkit-overflow-scrolling:touch properties are set, iOS appears to ignore any overflow:hidden properties on the parent, which is the page in our case. So if you have an image or code block that is wider than the viewport, horizontal scrolling will be seen.
  • When this feature is active, we are disabling user zoom by manipulating the meta viewport tag because both the toolbars and page content can easily be zoomed to an odd size and it's very difficult to zoom back out. Even though we believe in allowing users to zoom the page, alleviating the usability concerns we have with fixed toolbars and overflow containers is more important.
  • Scroll position can be lost when going back to a page that has been re-loaded. If DOM caching is on, this shouldn't be as much of an issue.
  • This is still an experimental feature, so not all the kinks have been worked out yet. Use with caution and test thoroughly.

Don’t other mobile platforms already support overflow?

Yes, but there’s a catch. Both Android Honeycomb and the Blackberry PlayBook support overflow: properties, but we found in testing that their implementation of overflow wasn't smooth enough, so pages would stutter and hang during scrolling, leading to an unusable experience. We're working with device makers to ensure that they are included when performance improves.

More importantly, targeting overflow correctly is a major issue. If we simply placed an overflow: auto CSS rule on the pages, other popular mobile platforms like older versions of Android and iOS would essentially just clip off the content and make it effectively inaccessible (yes, you can do a two-finger scroll gesture in iOS but nobody knows that). The smart thing about Apple’s implementation for iOS5 is that they added an additional CSS property -webkit-overflow-scrolling:touch that allows us to test for this touch scrolling property and, if supported, add in the overflow rules for just those browsers. This is the only safe way to target overflow without resorting to complex and unmaintainable user agent detection.

We will be working with device and browser makers to encourage support for both these CSS-based properties because we strongly believe that this a critical piece needed to build rich mobile web apps. The project will add any vendor-prefixed additions to touch scrolling property if, for example, Opera, Firefox or Microsoft added this support. Once people see how much better page transitions and fixed toolbars are on iOS5, we’re hoping this will be supported quickly by other browsers. JS-based scroller scripts may still have a place in this new world as a polyfill for browsers that don’t yet support these new CSS capabilities but we see this as a brief, interim tool in the evolution of the mobile web.

Debugging touchOverflow

Generally touchOverflow is only enabled on devices that support touch-scrolling of overflow areas, not desktop browsers. This can make it difficult to debug problems with the touchOverflow feature. To enable touchOverflow on all browsers, use the following code:

<script>
$(document).bind("mobileinit", function() {
  $.support.touchOverflow = true;
  $.mobile.touchOverflowEnabled = true;
});
</script>
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\transition-success.html jQuery Mobile Framework - Dialog Example

Ta-da!

That was an animated page transition effect that we added with a data-transition attribute on the link.

Since it uses CSS transforms, this should be hardware accelerated on many mobile devices.

What do you think?

I like it
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\docs-links-urltest\index.html jQuery Mobile Framework - Test URL Example

URL Test Page

This is a regular page that updated the url with a different value than was requested.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\animals.html Animals

Animals

All your favorites from aardvarks to zebras.

  • Pets
  • Farm Animals
  • Wild Animals
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\colors.html Colors

Colors

Fresh colors from the magic rainbow.

  • Blue
  • Green
  • Orange
  • Purple
  • Red
  • Yellow
  • Violet
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\index.html Dynamic Page Samples

Categories

Select a Category Below:

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\sample-reuse-page-external.html changePage JSON Sample

Categories

Select a Category Below:

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\sample-reuse-page.html changePage JSON Sample

Categories

Select a Category Below:

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\dynamic-samples\vehicles.html Vehicles

Vehicles

Everything from cars to planes.

  • Cars
  • Planes
  • Destruction
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes\theme-a.html jQuery Mobile Docs - Theming Pages

Theming pages

Home Search

Theme A Sample Page

This is an example of data-theme="a" applied to the same element as data-role="page", showing how the theme is inherited by widgets throughout the page.

Font styling:
Choose a pet:

Collapsible Sets

Section 1

I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the data-collapsed="false" attribute; to collapse me, either click my header or expand another header in my set.

Section 2

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Section 3

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Inset List

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes\theme-b.html jQuery Mobile Docs - Theming Pages

Theming pages

Home Search

Theme B Sample Page

This is an example of data-theme="b" applied to the same element as data-role="page", showing how the theme is inherited by widgets throughout the page.

Font styling:
Choose a pet:

Collapsible Sets

Section 1

I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the data-collapsed="false" attribute; to collapse me, either click my header or expand another header in my set.

Section 2

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Section 3

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Inset List

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes\theme-c.html jQuery Mobile Docs - Theming Pages

Theming pages

Home Search

Theme C Sample Page

This is an example of data-theme="c" applied to the same element as data-role="page", showing how the theme is inherited by widgets throughout the page.

Font styling:
Choose a pet:

Collapsible Sets

Section 1

I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the data-collapsed="false" attribute; to collapse me, either click my header or expand another header in my set.

Section 2

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Section 3

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Inset List

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes\theme-d.html jQuery Mobile Docs - Theming Pages

Theming pages

Home Search

Theme D Sample Page

This is an example of data-theme="d" applied to the same element as data-role="page", showing how the theme is inherited by widgets throughout the page.

Font styling:
Choose a pet:

Collapsible Sets

Section 1

I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the data-collapsed="false" attribute; to collapse me, either click my header or expand another header in my set.

Section 2

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Section 3

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Inset List

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\pages\pages-themes\theme-e.html jQuery Mobile Docs - Theming Pages

Theming pages

Home Search

Theme E Sample Page

This is an example of data-theme="e" applied to the same element as data-role="page", showing how the theme is inherited by widgets throughout the page.

Font styling:
Choose a pet:

Collapsible Sets

Section 1

I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the data-collapsed="false" attribute; to collapse me, either click my header or expand another header in my set.

Section 2

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Section 3

I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

Inset List

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-events.html jQuery Mobile Framework - Fixed Toolbars

Fixed toolbars

Home Search

Fixed toolbars

The fixedtoolbar plugin has the following custom events:

create triggered when a fixed toolbar is created

$( ".selector" ).fixedtoolbar({
   create: function(event, ui) { ... }
});		
						
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-a.html jQuery Mobile Framework - Fixed Toolbars

2,146 Songs

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-b.html jQuery Mobile Framework - Fixed Toolbars

Forms in fixed toolbar demos

These pages are designed to test fixed toolbars and form elements: demo app, text inputs, search inputs, radio toggles, checkbox toggles, slider, select, and buttons.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Embedded form

A bit more text

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-c.html jQuery Mobile Framework - Fixed Toolbars

Forms in fixed toolbar demos

These pages are designed to test fixed toolbars and form elements: demo app, text inputs, search inputs, radio toggles, checkbox toggles, slider, select, and buttons.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Embedded form

A bit more text

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-d.html jQuery Mobile Framework - Fixed Toolbars
Choose a pet:

Forms in fixed toolbar demos

These pages are designed to test fixed toolbars and form elements: demo app, text inputs, search inputs, radio toggles, checkbox toggles, slider, select, and buttons.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Embedded form

A bit more text

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-e.html jQuery Mobile Framework - Fixed Toolbars
Choose as many snacks as you'd like:

Forms in fixed toolbar demos

These pages are designed to test fixed toolbars and form elements: demo app, text inputs, search inputs, radio toggles, checkbox toggles, slider, select, and buttons.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Embedded form

A bit more text

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-f.html jQuery Mobile Framework - Fixed Toolbars

Forms in fixed toolbar demos

These pages are designed to test fixed toolbars and form elements: demo app, text inputs, search inputs, radio toggles, checkbox toggles, slider, select, and buttons.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Embedded form

A bit more text

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-g.html jQuery Mobile Framework - Fixed Toolbars

Forms in fixed toolbar demos

These pages are designed to test fixed toolbars and form elements: demo app, text inputs, search inputs, radio toggles, checkbox toggles, slider, select, and buttons.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Embedded form

A bit more text

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms-h.html jQuery Mobile Framework - Fixed Toolbars
Link

Forms in fixed toolbar demos

These pages are designed to test fixed toolbars and form elements: demo app, text inputs, search inputs, radio toggles, checkbox toggles, slider, select, and buttons.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Embedded form

A bit more text

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-forms.html jQuery Mobile Framework - Fixed Toolbars

Fixed + Forms

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-methods.html jQuery Mobile Framework - Fixed Toolbars

Fixed toolbars

Home Search

Fixed toolbars

The fixedtoolbar plugin has the following methods:

show show the toolbar

$("[data-position='fixed']").fixedtoolbar('show');

Note: Prior to version 1.1, the following syntax was used to show the toolbars, but it is no longer supported:


$.mobile.fixedToolbars.show(true);
hide hide the toolbar (if it's not a fullscreen toolbar, it'll toggle back to static positioning, which may or may not be hidden from view depending on scroll)

$("[data-position='fixed']").fixedtoolbar('hide');
		   				
toggle calls either the show or the hide method, depending on whether the toolbar is visible.

$("[data-position='fixed']").fixedtoolbar('toggle');
		   				
updatePagePadding update the padding (either top or bottom, depending on if the toolbar is a header or a footer) of the page element parent of the toolbar to match the height of the toolbar.

$("[data-position='fixed']").fixedtoolbar('updatePagePadding');
		   				

There is also an updatelayout event that can be used to trigger the toolbars to re-position. Developers who are building dynamic applications that inject content into the current page can also manually trigger this updatelayout event to ensure components on the page update in response to the new content that was just added. This event is used internally in the collapsible and listview filter plugins and is powerful because it's not toolbar-specific -- any widget can be built to listen for the updatelayout event to update the widget in response.

destroy destroy at fixedtoolbar (restore the element to its initial state)

$("[data-position='fixed']").fixedtoolbar('destroy');
		   				
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed-options.html jQuery Mobile Framework - Fixed Toolbars

Fixed toolbars

Home Search

Fixed toolbars

The fixedtoolbar plugin has the following options:

visibleOnPageShow boolean

default: true

This determines whether the toolbar is visible or not when its parent page is shown. This option is also exposed as a data attribute: data-visible-on-page-show="false"

$("[data-role=header]").fixedtoolbar({ visibleOnPageShow: false });
disablePageZoom boolean

default: true

This determines whether user-scaling should be disabled on pages that contain fixed toolbars. This option is also exposed as a data attribute: data-disable-page-zoom="false"

$("[data-role=header]").fixedtoolbar({ disablePageZoom: false });
transition string

default: "slide" (which ends up using slideup and slidedown)

The transition that should be used for showing and hiding a fixed toolbar. Possible values are "none", "fade", and "slide" (or you can write a CSS transition of your own and use that too). This option is also exposed as a data attribute: data-transition="fade"

$("[data-role=header]").fixedtoolbar({ transition: "fade" });
fullscreen boolean

default: false

Fullscreen fixed toolbars sit on top of the content at all times when they are visible, and unlike regular fixed toolbars, fullscreen toolbars do not fall back to static positioning when toggled, instead they disappear from the screen entirely. Fullscreen toolbars are ideal for more immersive interfaces, like a photo viewer that is meant to fill the entire screen with the photo itself and no distractions. This page demonstrates toolbars that use the fullscreen option. This option is also exposed as a data attribute: data-fullscreen="true"

$("[data-role=header]").fixedtoolbar({ fullscreen: true });

Note: While the data-attribute syntax for this option has not changed, it is now only supported on the toolbar element itself, and not the page element.

tapToggle boolean

default: true

Enable or disable the user's ability to toggle toolbar visibility with a tap on the screen (or a click, for mouse users). This option is also exposed as a data attribute: data-tap-toggle="true"

$("[data-role=header]").fixedtoolbar({ tapToggle: true });

Note: This behavior was formerly configurable as follows, but as of version 1.1 this syntax is no longer supported:

	
$.mobile.fixedToolbars
   .setTouchToggleEnabled(false);
tapToggleBlacklist string

default: "a, .ui-header-fixed, .ui-footer-fixed"

A list of jQuery selectors that, when tapped, will not cause the toolbars to be toggled.

$("[data-role=header]").fixedtoolbar({ tapToggleBlacklist: "a, button, input, select, textarea, .ui-header-fixed, .ui-footer-fixed" });
hideDuringFocus string

default: "input, select, textarea"

A list of jQuery selectors that should cause the toolbars to hide while focused, except if they are in a fixed toolbar.

$("[data-role=header]").fixedtoolbar({ hideDuringFocus: "input, select, textarea" });
updatePagePadding boolean

default: true

Since toolbars can vary in height depending on the content they contain, this option automatically updates the padding on the page element to ensure that fixed toolbars have adequate space in the document when they are statically positioned, and when scrolled to the top or bottom of the page. When enabled, the padding updates during many operations, such as pageshow, during page transitions, and on resize and orientationchange. As an optimization, we would recommend that you consider disabling this option and adding a rule to your CSS to set the padding of the page div to match the EM height of your toolbars, such as .ui-page-header-fixed { padding-top: 4.5em; }. This option is also exposed as a data attribute: data-update-page-padding="false"

$("[data-role=header]").fixedtoolbar({ updatePagePadding: false });
supportBlacklist function

default: function that returns a boolean value

CSS position: fixed support is very difficult to test; in fact, at the time of version 1.1 release, there was no known way to reasonably test for fixed support without turning up false positives or negatives in certain popular browsers. This option is a function that attempts to opt-out some popular platforms that are known to be troublesome with position: fixed . Often, these platforms support position: fixed partially, which can be worse than not supporting it at all. If overriding this option with your own blacklist logic, you simply need to provide a function that returns a true or false result when called upon initialization. You must set it on mobileinit, so that it applies when the plugin is initially created.


$( document ).bind("mobileinit", function(){
  $.mobile.fixedtoolbar.prototype.options.supportBlacklist = function(){
    var result;
    // logic to determine whether result should be true or false
    return result;
  };
})
initSelector CSS selector string

default: ":jqmData(position='fixed')"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as fixed toolbars. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
	$.mobile.fixedtoolbar.prototype.options.initSelector = ".myselector";
});
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fixed.html jQuery Mobile Framework - Fixed Toolbars

Fixed toolbars

Home Search

Fixed toolbars

In browsers that support CSS position: fixed (most desktop browsers, iOS5+, Android 2.2+, BlackBerry 6, and others), toolbars that use the "fixedtoolbar" plugin will be fixed to the top or bottom of the viewport, while the page content scrolls freely in between. In browsers that don't support fixed positioning, the toolbars will remain positioned in flow, at the top or bottom of the page.

To enable this behavior on a header or footer, add the data-position="fixed" attribute to a jQuery Mobile header or footer element.

Fixed header markup example:

	
<div data-role="header" data-position="fixed">
	<h1>Fixed Header!</h1>
</div>
		

Fixed footer markup example:

	
<div data-role="footer" data-position="fixed">
	<h1>Fixed Footer!</h1>
</div>
		

Fullscreen Toolbars

Fullscreen fixed toolbars sit on top of the content at all times when they are visible, and unlike regular fixed toolbars, fullscreen toolbars do not fall back to static positioning when toggled. Instead they disappear from the screen entirely. Fullscreen toolbars are ideal for more immersive interfaces, like a photo viewer that is meant to fill the entire screen with the photo itself and no distractions.

To enable this option on a fixed header or footer, add the data-fullscreen attribute to the element.

	
<div data-role="header" data-position="fixed" data-fullscreen="true">
	<h1>Fixed Header!</h1>
</div>
				

Forms in toolbars

While all form elements are now tested to work correctly within static toolbars as of jQuery Mobile 1.1, we recommend extensive testing when using form elements within fixed toolbars or within any position: fixed elements. This can potentially trigger a number of unpredictable issues in various mobile browsers, Android 2.2/2.3 in particular (detailed in Known issues in Android 2.2/2.3, below).

Changes in jQuery Mobile 1.1

Prior to version 1.1, jQuery Mobile used dynamically re-positioned toolbars for the fixed header effect because very few mobile browsers supported the position:fixed CSS property, and simulating fixed support through the use of "fake" JavaScript overflow-scrolling behavior would have reduced our browser support reach, in addition to feeling unnatural on certain platforms. This behavior was not ideal, and jQuery Mobile 1.1 took a new approach to fixed toolbars that allows much broader support. The framework now offers true fixed toolbars on many popular platforms, while gracefully degrading non-supporting platforms to static positioning.

Polyfilling older platforms

The fixed toolbar plugin degrades gracefully in platforms that do not support CSS position:fixed properly, such as iOS4.3. If you still need to support fixed toolbars on that platform (with the show/hide behavior) included in previous releases, Filament Group has developed a polyfill that you can use.

Just include the CSS and JS files after your references to jQuery Mobile and Fixed toolbars will work similar to jQuery Mobile 1.0 in iOS4.3, with the inclusion of the new API for the 1.1 fixedtoolbar plugin.

If you have any improvements to suggest, fork the gist on github and let us know!

Known issue with form controls inside fixed toolbars, and programmatic scroll

An obscure issue exists in iOS5 and some Android platforms where form controls placed inside fixed-positioned containers can lose their hit area when the window is programatically scrolled (using window.scrollTo for example). This is not an issue specific to jQuery Mobile, but because of it, we recommend not programatically scrolling a document when using form controls inside jQuery Mobile fixed toolbars. This ticket from the Device Bugs project tracker explains this problem in more detail.

Known issues in Android 2.2/2.3

Android 2.2/2.3’s implementation of position: fixed; can, in conjunction with seemingly unrelated styles and markup patterns, cause a number of strange issues, particularly in the case of position: absolute elements inside of position: fixed elements. While we’ve done our best to work around a number of these unique bugs within the scope of the library, custom styles may cause a number of issues.

  • Form elements elsewhere on the page—select menus in particular—can fail to respond to user interaction when an empty absolute positioned element is placed within a fixed position element. In rare cases—and specific to Android 2.2—this can cause entire pages to fail to respond to user interaction. This can seemingly be solved by adding any character to the absolute positioned element, including a non-breaking space, and in some cases even whitespace.
  • The above-described issue can also be triggered by an absolute positioned image inside of a fixed position element, but only when that image is using something other than its inherent dimensions. If a height or width is specified on the image using CSS, or the image src is invalid (thus having no inherent height and width), this issue can occur. If an image that is inherently, say, 50x50 pixels is placed in a fixed element and left at its inherent dimensions, this issue does not seem to occur.
  • When a position: fixed element appears anywhere on a page, most 2D CSS transforms will fail. Oddly, only translate transforms seem unaffected by this. Even more oddly, this issue is solved by setting a CSS opacity of .9 or below on the parent of the fixed element.
  • Combinations of position: fixed and overflow properties are best avoided, as both have been known to cause unpredictable issues in older versions of Android OS.
  • Any element that triggers the on-screen keyboard, when placed inside a position: fixed element, will fail to respond to user input when using anything other than the default keyboard. This includes Swype, XT9 or, it seems, any input method apart from the standard non-predictive keyboard.

While we will continue to try to find ways to mitigate these bugs as best we can, we currently advise against implementing fixed toolbars containing complicated user styles and form elements without extensive testing in all versions of Android’s native browser.

The following pages are designed to test fixed toolbars and form elements: demo app, text inputs, search inputs, radio toggles, checkbox toggles, slider, select, and buttons.

No longer supported: touchOverflowEnabled

Prior to jQuery Mobile 1.1, true fixed toolbar support was contingent on native browser support for the CSS property overflow-scrolling: touch, which is currently only supported in iOS5. As of version 1.1, jQuery Mobile no longer uses this CSS property at all. We've removed all internal usage of this property in the framework, but we've left it defined globally on the $.mobile object to reduce the risk that its removal will cause trouble with existing applications. This property is flagged for removal, so please update your code to no longer use it. The support test for this property, however, remains defined under $.support and we have no plans to remove that test at this time.


The rest of the page is just sample content to make the page very long

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

And an inset list


Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Embedded form

A bit more text

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

Fixed Footer

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-fullscreen.html jQuery Mobile Framework - Fullscreen Fixed toolbars

Fullscreen fixed header

Home Search
Photo Run

This page demonstrates the "fullscreen" toolbar mode. This toolbar treatment is used in special cases where you want the content to fill the whole screen, and you want the header and footer toolbars to appear and disappear when the page is clicked responsively — a common scenario for photo, image or video viewers.

To enable this toolbar feature type, you apply the data-fullscreen="true" attribute and the data-position="fixed" attribute to both the header and footer div elements, or whichever you want to be full-screen.

Keep in mind that the toolbars in this mode will sit over page content, so not all content will be accessible with the toolbars open, just as shown in this demo.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\bars-themes.html jQuery Mobile Framework - Theming Toolbars

Bar theming

Home Search

Both the header and footer bars will be styled by default with the theme's "a" color swatch (black in the default theme) because these bars are typically primary in the visual hierarchy of a page.

Theming headers and footers

To set the header or footer bars to a different color in your theme, add the data-theme attribute and specify the letter of the theme swatch (a, b, c, etc.). For example, this will set the bar to swatch "b" (blue in the default theme):

<div data-role="header" data-theme="b"> 
	<h1>Page Title</h1> 
</div> 

Theming buttons in toolbars

Any link added inside the header block will be automatically styled as a button that matches the color of the bar's theme swatch. To make a button stand out as a primary call to action, the data-theme attribute can be used to specify a contrasting button color from a different theme swatch. For example, if we set the header to theme "c" (light gray), both buttons would be styled as the "c" button by default. If we wanted the Save button to visually pop, we can override the color by setting the data-theme attribute to "b" (blue in our default theme) on the Save button's anchor.

<a href="add-user.php" data-theme="b">Save</a> 

Theme variations

This is a demo of the variation that can be achieved by tweaking the theme swatches and buttons inside the headers and footers.

Headers

Bar swatch "a"

New
Cancel

Bar swatch "a"

Save

Bar swatch "b"

New
Cancel

Bar swatch "b"

Save

Bar swatch "c"

New
Cancel

Bar swatch "c"

Save

Bar swatch "d"

New
Cancel

Bar swatch "d"

Save

Bar swatch "e"

New
Cancel

Bar swatch "e"

Save

Footers

These are examples of a footer with link buttons inside. Note that footers do not have the same prescriptive markup conventions as headers with button slots so use layout grids or custom styles to achieve the design you want.

left right up down
left right up down
left right up down
left right up down
left right up down
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\docs-bars.html jQuery Mobile Docs - Toolbar Basics

Toolbar basics

Home Search

Toolbar types

In jQuery Mobile, there are two standard types of toolbars: Headers and Footers.

  • The Header bar serves as the page title, is usually the first element inside each mobile page, and typically contains a page title and up to two buttons.
  • The Footer bar is usually the last element inside each mobile page, and tends to be more freeform than the header in terms of content and functionality, but typically contains a combination of text and buttons.

It's very common to have a horizontal navigation or tab bar inside the header or footer; jQuery Mobile includes a navbar widget that turns an unordered list of links into a horizontal button bar, which works well in these instances.

View the data- attribute reference to see all the possible attributes you can add to toolbars.

Toolbar positioning options

Header and footers can be positioned on the page in a few different ways. By default, the toolbars use the "inline" positioning mode. In this mode, the headers and footer sit in the natural document flow (the default HTML behavior), which ensures that they are visible on all devices, regardless of JavaScript and CSS positioning support.

A "fixed" positioning mode fixes the toolbars to either the top or bottom of the viewport on browsers that support CSS fixed positioning (which includes most desktop browsers, iOS5+, Android 2.2+, BlackBerry 6, and others). In browsers that don't support fixed positioning, the toolbars will fall back to static, inline position in the page.

When tap-toggling is enabled, tapping the screen will toggle the visibility of the fixed toolbars. Tapping the page when the toolbars aren't visible brings them into view. Tapping again hides them until you tap again. This gives users the option to hide the toolbars until needed to maximize screen real estate. One caveat is that fixed toolbars never truly hide, but toggle between fixed and static positioning. This means that if you're at the top of a page, you can't tap-toggle a header toolbar out of view, as it instead toggles into its spot in the document flow at the top of the page. The same goes for fixed footers when scrolled to the very bottom of a document.

To set this behavior on a header or footer, add the data-position="fixed" attribute to the header or footer element.

A "fullscreen" position mode works just like the fixed mode except that the toolbars overlay the page content, rather than reserving a place in the document when not in fixed mode. This is useful for immersive apps like photo or video viewers where you want the content to fill the whole screen and toolbars can be hidden or summoned to appear by tapping the screen. Keep in mind that the toolbars in this mode will sit over page content so this is best used for specific situations.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\docs-footers.html jQuery Mobile Docs - Footer Configuration

Footers

Home Search

Footer bar structure

The footer bar has the same basic structure as the header except it uses the data-role attribute value of footer.

<div data-role="footer"> 
	<h4>Footer content</h4> 
</div> 

The footer toolbar will be themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.

Footer content

The page footer is very similar to the header in terms of options and configuration. The primary difference is that the footer is designed to be less structured than the header to allow more flexibility, so the framework doesn't automatically reserve slots for buttons to the left or right as it does in headers.

Since footers do not have the same prescriptive markup conventions as headers, we recommend using layout grids or writing custom styles to achieve the design you want.

Adding buttons

Any link or valid button markup added to the footer will automatically be turned into a button. To save space, buttons in toolbars are automatically set to inline styling so the button is only as wide as the text and icons it contains.

By default, toolbars don't have any padding to accommodate nav bars and other widgets. To include padding on the bar, add a class="ui-bar" to the footer.


<div data-role="footer" class="ui-bar">
	<a href="index.html" data-role="button" data-icon="plus">Add</a>
	<a href="index.html" data-role="button" data-icon="arrow-u">Up</a>
	<a href="index.html" data-role="button" data-icon="arrow-d">Down</a>
</div>

This creates this toolbar with buttons sitting in a row

Note that .ui-bar should not be added to header or footer bars that span the full width of the page, as the additional padding will cause a full-width element to break out of its parent container. To add padding inside of a full-width toolbar, wrap the toolbar's contents in an element and apply the padding to that element.

To group buttons together into a button set, wrap the links in a wrapper with data-role="controlgroup" and data-type="horizontal" attributes.

<div data-role="controlgroup" data-type="horizontal">

This creates a grouped set of buttons:

Adding form elements

Forms elements and other content can also be added to toolbars. Here is an example of a select menu inside a footer bar. We recommend using mini-sized form elements in toolbars by adding the data-mini="true" attribute:

Fixed & Persistent footers

In situations where the footer is a global navigation element, you may want it to appear fixed so it doesn't scroll out of view. It's also possible to make a fixed toolbar persistent so it appears to not move between page transitions. This can be accomplished by using the persistent footer feature included in jQuery Mobile.

To make a footer persistent between transitions, add the data-id attribute to the footer of all relevant pages and use the same id value for each. For example, by adding data-id="myfooter" to the current page and the target page, the framework will keep the footer anchors in the same spot during the page animation. This effect will only work correctly if the header and footer toolbars are set to data-position="fixed" so they are in view during the transition.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\docs-headers.html jQuery Mobile Docs - Header Bars

Headers

Home Search

Header structure

The header is a toolbar at the top of the page that usually contains the page title text and optional buttons positioned to the left and/or right of the title for navigation or actions. Headers can optionally be positioned as fixed so they remain at the top of the screen at all times instead of scrolling with the page.

The title text is normally an H1 heading element but it's possible to use any heading level (H1-H6) to allow for semantic flexibility. For example, a page containing multiple mobile "pages" may use a H1 element on the home "page" and a H2 element on the secondary pages. All heading levels are styled identically by default to maintain visual consistency.

<div data-role="header"> 
	<h1>Page Title</h1> 
</div> 

Default header features

The header toolbar is themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.

Page title

Adding buttons

In the standard header configuration, there are slots for buttons on either side of the text heading. Each button is typically an anchor element, but any valid button markup will work. To save space, buttons in toolbars are set to inline styling so the button is only as wide as the text and icons it contains.

Default button positioning

The header plugin looks for immediate children of the header container, and automatically sets the first link in the left button slot and the second link in the right. In this example, the 'Cancel' button will appear in the left slot and 'Save' will appear in the right slot based on their sequence in the source order.

			
<div data-role="header">
	<a href="index.html" data-icon="delete">Cancel</a>
	<h1>Edit Contact</h1>
	<a href="index.html" data-icon="check">Save</a>
</div>
Cancel

Edit Contact

Save

Making buttons visually stand out

Buttons automatically adopt the swatch color of the bar they sit in, so a link in a header bar with the "a" color will also be styled as "a" colored buttons. It's simple to make a button visually stand out. Here, we add the data-theme attribute and set the color swatch for the button to "b" to make the "Save" button pop.

			
<div data-role="header">
	<a href="index.html" data-icon="delete">Cancel</a>
	<h1>Edit Contact</h1>
	<a href="index.html" data-icon="check" data-theme="b">Save</a>
</div>
Cancel

Edit Contact

Save

Controlling button position with classes

The button position can also be controlled by adding classes to the button anchors, rather than relying on source order. This is especially useful if you only want a button in the right slot. To specify the button position, add the class of ui-btn-left or ui-btn-right to the anchor.


<div data-role="header">
	<h1>Page Title</h1>
	<a href="index.html" data-icon="gear" class="ui-btn-right">Options</a>
</div>

Page Title

Options

Adding buttons to toolbars without heading

The heading in the header bar has some margin that will give the bar its height. If you choose not to use a heading, you will need to add an element with class="ui-title" so that the bar can get the height and display correctly.


<div data-role="header">
	<a href="index.html" data-icon="gear" class="ui-btn-right">Options</a>
	<span class="ui-title" />
</div>
	
Options

Adding Back buttons

jQuery Mobile has a feature to automatically create and append "back" buttons to any header, though it is disabled by default. This is primarily useful in chromeless installed applications, such as those running in a native app webview. The framework automatically generates a "back" button on a header when the page plugin's addBackBtn option is true. This can also be set via markup if the page div has a data-add-back-btn="true" attribute.

If you use the attribute data-rel="back" on an anchor, any clicks on that anchor will mimic the back button, going back one history entry and ignoring the anchor's default href. This is particularly useful when linking back to a named page, such as a link that says "home", or when generating "back" buttons with JavaScript, such as a button to close a dialog. When using this feature in your source markup, be sure to provide a meaningful href that actually points to the URL of the referring page. This will allow the feature to work for users in C-Grade browsers.

If you just want a reverse transition without actually going back in history, you should use the data-direction="reverse" attribute.

Customizing the back button text

If you'd like to configure the back button text, you can either use the data-back-btn-text="previous" attribute on your page element, or set it programmatically via the page plugin's options:
$.mobile.page.prototype.options.backBtnText = "previous";

Default back button style

If you'd like to configure the back button role-theme, you can use:
$.mobile.page.prototype.options.backBtnTheme = "a";
If you're doing this programmatically, set this option inside the mobileinit event handler.

Custom header configurations

If you need to create a header that doesn't follow the default configuration, simply wrap your custom styled markup in any container, such as div. The plugin won't apply the automatic button logic to the wrapped content inside the header container so you can write custom styles for laying out the content in your header.

It's also possible to create custom bars without using the header data-role at all. For example, start with any container and add the ui-bar class to apply standard bar padding and add the ui-bar-b class to assign the bar swatch styles from your theme. (The "b" can be any swatch letter.)


<div class="ui-bar ui-bar-b">
	<h3>I'm just a div with bar classes and a mini inline <a href="#" data-role="button" data-mini="true">Button</a></h3>
</div>
			

This will produce this bar:

I'm just a div with bar classes and a mini inline Button

Note that .ui-bar should not be added to header or footer bars that span the full width of the page, as the additional padding will cause a full-width element to break out of its parent container. To add padding inside of a full-width toolbar, wrap the toolbar's contents in an element and apply the padding to that element instead.

By writing some simple styles, it's easy to build message bars like this:

This is an alert message.

And here's some additional text in a paragraph.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\docs-navbar.html jQuery Mobile Docs - Navbar

Navbar

Home Search

Simple navbar

jQuery Mobile has a very basic navbar widget that is useful for providing up to 5 buttons with optional icons in a bar, typically within a header or footer. There is also a persistent navbar variation that works more like a tab bar that stays fixed as you navigate across pages.

A navbar is coded as an unordered list of links wrapped in a container element that has the data-role="navbar" attribute. This is an example of a two-button navbar:


<div data-role="navbar">
	<ul>
		<li><a href="a.html">One</a></li>
		<li><a href="b.html">Two</a></li>
	</ul>
</div><!-- /navbar -->

When a link in the navbar is clicked it gets the active (selected) state. The ui-btn-active class is first removed from all anchors in the navbar before it is added to the activated link. If this is a link to another page, the class will be removed again after the transition has completed.

To set an item to the active state upon initialization of the navbar, add class="ui-btn-active" to the corresponding anchor in your markup. Additionaly add a class of ui-state-persist to make the framework restore the active state each time the page is shown while it exists in the DOM. The example below shows a navbar with item "One" set to active:


<div data-role="navbar">
	<ul>
		<li><a href="a.html" class="ui-btn-active ui-state-persist">One</a></li>
		<li><a href="b.html">Two</a></li>
	</ul>
</div><!-- /navbar -->

The navbar items are set to divide the space evenly so in this case, each button is 1/2 the width of the browser window:

Adding a third item will automatically make each button 1/3 the width of the browser window:

Adding a fourth more item will automatically make each button 1/4 the width of the browser window:

The navbar maxes out with 5 items, each 1/5 the width of the browser window:

If more than 5 items are added, the navbar will simply wrap to multiple lines:

Navbars with 1 item will simply render as 100%.

Navbars in headers

If you want to add a navbar to the top of the page, you can still have a page title and buttons. Just add the navbar container inside the header block, right after the title and buttons in the source order.

I'm a header

Options

Navbars in footers

If you want to add a navbar to the bottom of the page so it acts more like a tab bar, simply wrap the navbar in a container with a data-role="footer"


<div data-role="footer">		
	<div data-role="navbar">
		<ul>
			<li><a href="#">One</a></li>
			<li><a href="#">Two</a></li>
			<li><a href="#">Three</a></li>
		</ul>
	</div><!-- /navbar -->
</div><!-- /footer -->

Icons in navbars

Icons can be added to navbar items by adding the data-icon attribute specifying a standard mobile icon to each anchor. By default, icons are added above the text (data-iconpos="top"). The following examples add icons to a navbar in a footer.

The icon position is set on the navbar container instead of for individual links within for visual consistency. For example, to place the icons below the labels, add the data-iconpos="bottom" attribute to the navbar container.


<div data-role="navbar" data-iconpos="bottom">

This will result in a bottom icon alignment:

The icon position can be set to data-iconpos="left":

Or the icon position can be set to data-iconpos="right":

Using 3rd party icon sets

You can add any of the popular icon libraries like Glyphish to achieve the iOS style tab that has large icons stacked on top of text labels. All that is required is a bit of custom styles to link to the icons and position them in the navbar. Here is an example using Glyphish icons and custom styles (view page source for styles) in our navbar:

Icons by Joseph Wain / glyphish.com. Licensed under the Creative Commons Attribution 3.0 United States License.

Theming navbars

Navbars inherit the theme swatch from their parent container, just like buttons. If a navbar is placed in the header or footer toolbar, it will inherit the default toolbar swatch "a" for bars unless you set this in the markup.

Here are a few examples of navbars in various container swatches that automatically inherit their parent's swatch letter. Note that in these examples, instead of using a data-theme attribute, we're manually adding the swatch classes to apply the body swatch (ui-body-a) and the class to add the standard body padding (ui-body), but the inheritance works the same way:

Swatch "a"

Swatch "b"

To set the theme color for a navbar item, add the data-theme attribute to the individual links and specify a theme swatch. Note that applying a theme swatch to the navbar container is not supported.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\footer-persist-a.html jQuery Mobile Framework - Persistent footer A

Info

Home Search

About persistent toolbars

These pages are a demo of persistent toolbars. Click on any of the links in the footer, and you'll see the page content transition. But both, the persistent header and footer on these pages, remains in place during the animation to a new HTML page.

To tell the framework to apply the persistent behavior, add the same data-id attribute to the header and/or footer of all HTML pages in the navigation. It's that simple: If the page you're navigating to has a header or footer with the same data-id as the page you're navigating from, the toolbars will appear fixed outside of the transition. Each of the pages in this demo has a different transition to test out how this works.

Typically, the persistent toolbar technique will be combined with fixed positioning. In this example, the footer also has a navbar, like this:

	
<div data-role="footer" data-id="foo1" data-position="fixed">
	<div data-role="navbar">
		<ul>
			<li><a href="a.html">Info</a></li>
			<li><a href="b.html">Friends</a></li>
			<li><a href="c.html">Albums</a></li>
			<li><a href="d.html">Emails</a></li>
		</ul>
	</div><!-- /navbar -->
</div><!-- /footer -->

To set the active state of an item in a persistent toolbar, add class="ui-btn-active ui-state-persist" to the corresponding anchor.

	
<li><a href="a.html" class="ui-btn-active ui-state-persist">Info</a></li>

A note about transitions

The slide, slideup, slidedown, fade or none page transitions all work great with persistent fixed toolbars. However, intensive 3D transitions like flip, turn, and flow can cause positioning and animation performance issues with this technique so we don't recommend using them.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\footer-persist-b.html jQuery Mobile Framework - Persistent footer B

Friends

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\footer-persist-c.html jQuery Mobile Framework - Persistent footer C

Albums

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\footer-persist-d.html jQuery Mobile Framework - Persistent footer D

Inbox

Home Search
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter18\jquery.mobile-1.1.1\demos\docs\toolbars\index.html jQuery Mobile Docs - Toolbars

Toolbars

Home Search

Toolbars are used for headers, footers, and utility bars throughout mobile sites and applications. jQuery Mobile provides a standard set of bars and navigation tools to cover most standard scenarios.

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter20\ajax.html AJAX Test
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter20\isbn-full.html ISBN
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter20\isbn.html ISBN
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\default.html  SplitApp1
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\bin\Debug\AppX\default.html  SplitApp1
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\bin\Debug\AppX\pages\items\items.html  itemsPage

SplitApp1

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\bin\Debug\AppX\pages\split\split.html  splitPage

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\pages\items\items.html  itemsPage

SplitApp1

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter22\SplitApp1\SplitApp1\pages\split\split.html  splitPage

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\default.html  MyWX
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\bin\Debug\AppX\default.html  MyWX
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\bin\Debug\AppX\pages\items\items.html  itemsPage

MyWX

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\bin\Debug\AppX\pages\split\split.html  splitPage

Temperature:
Wind:
######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\pages\items\items.html  itemsPage

MyWX

######################### ######################### ######################### #### ------> C:\Users\pasch\OneDrive\Dokumente\JavaScript Step by Step, 3rd EditionCode\Chapter23\MyWX\MyWX\pages\split\split.html  splitPage

Temperature:
Wind:
######################### ######################### #########################