CS 174: Web Programming April 9 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak www.cs.sjsu.edu/~mak.

Slides:



Advertisements
Similar presentations
The jQuery library. What is jQuery ? A javascript lightweight library Is very easy to use Is powerful Is cross-browser compatible Downloadable from jQuery.com,
Advertisements

JQuery A Javascript Library Hard things made eas(ier) Norman White.
Dawn Pedersen Art Institute. What is Spry? Spry is Dreamweaver’s version of JavaScript libraries. Spry effects alter the look of a page element—or of.
School of Computing and Information Systems CS 371 Web Application Programming jQuery.
© 2010 Delmar, Cengage Learning Chapter 1 Getting Started with Dreamweaver.
Fall 2012 CSC9010 Web Technologies Web Tool Presentation Randy Escoto.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Chapter 1 Getting Started With Dreamweaver. Explore the Dreamweaver Workspace The Dreamweaver workspace is where you can find all the tools to create.
ICS 665 Jesse Abdul. jQuery UI Overview  jQuery UI javascript library Includes all UI component functionality  jQuery UI CSS framework Includes standard.
CS 174: Web Programming April 16 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
By Ronald Lopez and Bryan Cabalo. Outline jQuery UI overview Animation and special effects Themable widgets Versions and browser compatibility jQuery.
Fundamentals, DOM, Events, AJAX, UI Doncho Minkov Telerik Corporation
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
 jQuery Mobile An Introduction. What is jQuery Mobile  A framework built on top of jQuery, used for creating mobile web applications  Designed to make.
JQUERY – UI & THEMES "WRITE LESS, DO MORE" Built in interface elements.
JQuery CS 268. What is jQuery? From their web site:
CS 174: Web Programming April 21 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
CS 174: Web Programming April 7 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
PhpXperts What is jQuery Javascript Library Fast and concise Simplifies the interaction between HTML and JavaScript.
Nguyen Ich Cuong.  Course duration: 45’  Purpose: Present Introduction to JQuery  Targeted attendees: NICorp Trainee  Tests/quiz: Yes - 10’
JQuery Adding behaviour…. Lecture Plan Review of last lesson Adding behaviour –click, mouseover Animation –fade, slideDown Navigation –parent, find, next.
13. jQuery See the official documentation at  See the terse API documentation at
JQuery UI. Slide 2 Introduction From the jQuery UI Home Page jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built.
CS 235: User Interface Design October 15 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Domain 3 Understanding the Adobe Dreamweaver CS5 Interface.
CS 174: Web Programming September 30 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 235: User Interface Design September 22 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
Animation & Effects Using JQuery. What is jQuery? jQuery is a lightweight, JavaScript library. The purpose of jQuery is to make it much easier to use.
Chapter 2 – Introduction to the Visual Studio .NET IDE
JQuery Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
Tutorial 3 Adding and Formatting Text with CSS Styles.
Unleash the Power of jQuery Learning & Development Team Telerik Software Academy.
CS 174: Web Programming November 4 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
CS 174: Web Programming October 26 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Chapter 11 Adding Media and Interactivity. Chapter 11 Lessons Introduction 1.Add and modify Flash objects 2.Add rollover images 3.Add behaviors 4.Add.
Understanding JavaScript and Coding Essentials Lesson 8.
CS 235: User Interface Design March 17 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
CS 160 and CMPE/SE 131 Software Engineering February 11 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
JQuery Animation. If you look at example1.html, you will see that it is a basic web page with links to the jquery library, and a script.js file and some.
CS 174: Web Programming October 28 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
COM621: Advanced Interactive Web Development Lecture 6 – JavaScript (cont.)
HTML5 and CSS3 Illustrated Unit E: Inserting and Working with Links.
Getting Started with Dreamweaver
CMPE 280 Web UI Design and Development September 28 Class Meeting
12/04/12 JQuery I took these slides from the site because they were pretty good looking. Instructions for editing school and department titles: Select.
JavaScript is a programming language designed for Web pages.
Chapter 2 – Introduction to the Visual Studio .NET IDE
JQuery UI.
Tutorial 6 Topic: jQuery and jQuery Mobile Li Xu
JQUERY Online TRAINING AT GOLOGICA
Fundamentals, DOM, Events, AJAX, UI
CMPE 280 Web UI Design and Development March 1 Class Meeting
Tutorial 4: jQuery Mobile
HTML5 Level II Session III
JQuery UI Plug-ins, Object Models & the Window Object
HTML Level II (CyberAdvantage)
Web Programming Language
Getting Started with Dreamweaver
Web Programming Language
SEEM4570 Tutorial 5: jQuery + jQuery Mobile
jQuery Widgets: Tabs Requires core jQuery library + jQuery UI
CMPE 280 Web UI Design and Development February 28 Class Meeting
JavaScript Basics What is JavaScript?
CMPE 152: Compiler Design February 28 / March 5 Lab
CMPE 152: Compiler Design March 7/12 Lab
JavaScript: BOM and DOM CS Programming Languages for Web Applications
Presentation transcript:

CS 174: Web Programming April 9 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak jQuery Object Effects 2 MethodOperation show() Make the object visible. hide() Make the object invisible. toggle() Toggle visible/invisible. fadeIn() Fade the object in. fadeOut() Fade the object out. fadeToggle() Toggle fade in/fade out. slideDown() Slide the object into view from top to bottom. slideUp() Slide the object out of view from bottom to top. slideToggle() Toggle slide down/slide up.

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak jQuery Object Effects, cont’d 3 $(init); var showing = false; var wrapped = false; function init() { $("#content").hide(); $("#show").click(showContent); $("#hide").click(hideContent); $("#toggle").click(toggleContent); $("#slideDown").click(slideDown); $("#slideUp").click(slideUp); $("#fadeIn").click(fadeIn); $("#fadeOut").click(fadeOut); $("#wrap").click(wrapImage); $("#unwrap").click(unwrapImage); } effects.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak jQuery Object Effects, cont’d 4 function showContent() { $("#content").show(); showing = true; } function hideContent() { $("#content").hide(); showing = false; } function toggleContent() { $("#content").toggle(); showing = !showing; } effects.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak jQuery Object Effects, cont’d 5 function slideDown() { $("#content").slideDown("medium"); showing = true; } function slideUp() { $("#content").slideUp(500); showing = false; } effects.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak jQuery Object Effects, cont’d 6 function fadeIn() { $("#content").fadeIn(1000, meow); showing = true; } function fadeOut() { $("#content").fadeOut("fast"); showing = false; } function meow() { alert("MEOW!"); } effects.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak jQuery Object Effects, cont’d 7 function wrapImage() { if (showing) { $("#image").wrap(" "); wrapped = true; } function unwrapImage() { if (showing && wrapped) { var image = $("#image").clone(); $(".wrapped").remove(); $("#content").append(image); wrapped = false; } effects.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak The jQuery User Interface Toolkit  The jQuery User Interface Toolkit is built on top of the jQuery library.  New cross-platform UI features: UI elements: scrollbars  tabs, date pickers, etc. Advanced user interaction  drag and drop  resize objects Theme templates  control your application’s look and feel Icon library 8

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak The jQuery User Interface Toolkit, cont’d  Build a modern application. That just happens to run inside a web browser. Add visual effects.  Open source Download from 9

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Themes  A jQuery theme is a visual rule set. Defines a particular look and feel. Implemented by a complex CSS document that you can download and link to your web pages.  Visit the jQuery Theme Roller at Widgets (tool objects) of jQuery UI. Select and download themes. Modify themes or create new themes. 10

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Drag an Object  Call a jQuery object’s draggable() function to an object to enable it to be dragged with a mouse. 11

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Drag an Object, cont’d 12 Drag <script type="text/javascript" src="js/jquery.js"> <script type="text/javascript" src="js/jquery-ui-lightness/jquery-ui.min.js"> <script type="text/javascript" src="js/drag.js"> Drag Demo $(init); function init() { $("#dragMe").draggable(); } drag.html drag.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak UI Icons  Each UI Toolkit download includes an images folder that contains the icon files.  To insert an icon, create a span where icon-name is obtained from the Theme Roller. Hover the mouse over the desired icon to see its name. 13

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak jQuery UI Toolkit Classes for CSS 14

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Resize an Object  Call a jQuery object’s resizable() function to an object to enable it to be resized with a mouse.  Add the following jQuery UI classes to the object: ui-widget ui-widget-content ui-corner-all 15

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Resize an Object, cont’d 16 <meta http-equiv="content-type" content="text/xml; charset=utf-8" /> <link rel = "stylesheet" type = "text/css" href = "css/jquery-ui-lightness/jquery-ui.min.css" /> <link rel = "stylesheet" type = "text/css" href = "css/resize.css" /> <script type = "text/javascript" src = "js/jquery.js"> <script type = "text/javascript" src = "js/jquery-ui-lightness/jquery-ui.min.js"> <script type = "text/javascript" src="js/resize.js"> resize.html resize.html

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Resize an Object, cont’d 17 Resize Demo Resize me Drag a corner or side to resize. resize.html

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Resize an Object, cont’d 18 $(init); function init() { $("#resizeMe").resizable(); $("div").addClass("ui-widget").addClass("ui-widget-content").addClass("ui-corner-all"); $(":header").addClass("ui-widget-header").addClass("ui-corner-all"); } resize.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Drag and Drop an Object  Call a jQuery object’s droppable() function to an object to enable it to be a drop target.  Use the bind() function to bind drop-in and drop-out events to the object. Attach a callback function to each event.  UI variable ui-draggable refers to the object that triggered the drop-in callback function. 19

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Drag and Drop an Object, cont’d 20 Drag and Drop Demo DRAG ME DROP HERE dragdrop.html

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Drag and Drop an Object, cont’d 21 $(init); function init() { cloneDragMe(); $(".dragMe").draggable(); $("#target").droppable(); $("#target").bind("drop", highlightTarget); $("#target").bind("dropout", resetTarget); } dragdrop.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Drag and Drop an Object, cont’d 22 function highlightTarget(event, ui) { $("#target").addClass("ui-state-highlight").html("Dropped ").append(ui.draggable.text()); } function resetTarget(event, ui) { $("#target").removeClass("ui-state-highlight").html("Drop on me"); } dragdrop.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Drag and Drop an Object, cont’d 23 function cloneDragMe() { for (i = 1; i <= 4; i++){ zValue = i; yPos = *i + "px"; $("div:first").clone().insertAfter("div:last").css("top", yPos).css("zIndex", zValue).append(" #" + i); } dragdrop.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak jQuery UI Widgets  Popular jQuery UI widgets include: accordion tabs date picker slider selectable elements sortable lists dialog boxes 24

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Accordion Widget  Create an outer div to be the accordion widget.  Create a heading for each collapsible element of the accordion widget. The headings are contained in the outer div. Make all the headings at the same level.  Follow each heading with an inner div to contain the contents of the collapsible element. 25

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Accordion Widget, cont’d 26 Accordion Demo CS 149 Operating Systems Fundamentals: Contiguous and non-contiguous... Prerequisite: CS 146 or SE 146 (with a grade of "C-" or better). CS 153 Compiler Design... accordion.html

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Accordion Widget, cont’d 27 $(init); function init() { $("#accordion").accordion(); } accordion.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Tabs Widget  Create an outer div to be the tabs widget.  The first element contained in the div must be an ordered or unordered list to serve as the tabs directory.  Each list item is a local link to an inner div that contains the tab contents. 28

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Tabs Widget, cont’d 29 Tabs Demo CS 149 CS 153 CS 174 CS $(init); function init() { $("#tabs").tabs(); } tabs.html tabs.js

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak AJAX Tabs  Use AJAX to obtain the contents of a tab.  Specify the file to be loaded from the server as a link in the corresponding item in the tabs directory list. 30

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak AJAX Tabs, cont’d 31 AJAX Tabs Demo CS 149 CS 153 CS 174 CS 235 ajaxtabs.html

Computer Science Dept. Spring 2015: April 9 CS 174: Web Programming © R. Mak Assignment #5  Add jQuery and jQuery UI widgets to your web application. Use a jQuery Theme. Up to 10 points extra credit if you create (or modify) a theme.  Turn in the usual zip file containing source files, database dump, and screen shots.  Due Friday, April