Information Design. Professor Danne Woo! infodesign.dannewoo.com! ARTS 269 Fall 2018 Friday 10:00PM 1:50PM I-Building 212

Similar documents
729G26 Interaction Programming. Lecture 4

HCDE 530: Computational Techniques for HCDE Data Visualization in Web, Part 2

HTML5 and CSS3 The jquery Library Page 1

of numbers, converting into strings, of objects creating, sorting, scrolling images using, sorting, elements of object

PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore WEB PROGRAMMING Solution Set II

PHP / MYSQL DURATION: 2 MONTHS

Chapter 9 Introducing JQuery

JavaScript and Events

COMS 469: Interactive Media II

Hell is other browsers - Sartre. The touch events. Peter-Paul Koch (ppk) WebExpo, 24 September 2010

Tizen Web UI Technologies (Tizen Ver. 2.3)

IDM 231. Functions, Objects and Methods

JavaScript Introduction

B. V. Patel Institute of Business Management, Computer and Information Technology, UTU. B. C. A (3 rd Semester) Teaching Schedule

Introduction to. Maurizio Tesconi May 13, 2015

SEEM4570 System Design and Implementation Lecture 04 jquery

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

JavaScript: Events, DOM and Attaching Handlers

Hell is other browsers - Sartre. The touch events. Peter-Paul Koch (ppk) DIBI, 28 April 2010

jquery Tutorial for Beginners: Nothing But the Goods

Chapter 1 Introduction to Computers and the Internet

CSI 3140 WWW Structures, Techniques and Standards. Browsers and the DOM

5. Strict mode use strict ; 6. Statement without semicolon, with semicolon 7. Keywords 8. Variables var keyword and global scope variable 9.

Produced by. App Development & Modeling. BSc in Applied Computing. Eamonn de Leastar

Photo from DOM

HTML5. HTML5 Introduction. Form Input Types. Semantic Elements. Form Attributes. Form Elements. Month Number Range Search Tel Url Time Week

PIC 40A. Lecture 10: JS: Wrapper objects, Input and Output, Control structures, random numbers. Copyright 2011 Jukka Virtanen UCLA 1 04/24/17

CS193X: Web Programming Fundamentals

Frontend II: Javascript and DOM Programming. Wednesday, January 7, 15

Catching Events. Bok, Jong Soon

Week 8 Google Maps. This week you ll learn how to embed a Google Map into a web page and add custom markers with custom labels.

Acknowledgments. Who Should Read This Book?...xxiv How to Read This Book...xxiv What s in This Book?...xxv Have Fun!...xxvi

Design patterns and Animation with jquery. with Paul Bakaus

Stamp Builder. Documentation. v1.0.0

EECS1012. Net-centric Introduction to Computing. Lecture JavaScript Events

I'm Remy. Who uses jquery.

title shown on page tab <meta attribute="value"... /> page metadata (h1 for largest to h6 for smallest) emphasis (italic) strong emphasis (bold)

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

Pearson Education Limited Edinburgh Gate Harlow Essex CM20 2JE England and Associated Companies throughout the world

Lesson 5 Introduction to Cascading Style Sheets

Frontend guide. Everything you need to know about HTML, CSS, JavaScript and DOM. Dejan V Čančarević

WELCOME TO JQUERY PROGRAMMING LANGUAGE ONLINE TUTORIAL

HTML5, CSS3, JQUERY SYLLABUS

JavaScript: More Syntax and Using Events

Web Development & Design Foundations with HTML5

Skyway Builder Web Control Guide

JQuery and Javascript

CSE 154 LECTURE 10: MORE EVENTS

Introduction to HTML & CSS. Instructor: Beck Johnson Week 5

Mobile Site Development

showinplaceholder The jquery Plug-in


1. Cascading Style Sheet and JavaScript

Javascript Methods. concat Method (Array) concat Method (String) charat Method (String)

CSC 337. jquery Rick Mercer

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

Diploma in Digital Applications Unit 5: Coding for the Web

CSC309 Winter Lecture 2. Larry Zhang

Chapter 1 Introduction to Dreamweaver CS3 1. About Dreamweaver CS3 Interface...4. Creating New Webpages...10

Javascript Hierarchy Objects Object Properties Methods Event Handlers. onload onunload onblur onfocus

Website Development with HTML5, CSS and Bootstrap

Creating Content with iad JS

Outline. Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

Positioning in CSS: There are 5 different ways we can set our position:

Mark Scheme. Edexcel Level 2 Certificate in Digital Applications. Unit 5: Coding for the Web

Webomania Solutions Pvt. Ltd. 2017

NAVIGATION INSTRUCTIONS

INTRODUCTION TO WEB DEVELOPMENT AND HTML. Lecture 15: JavaScript loops, Objects, Events - Spring 2011

Welcome to CS50 section! This is Week 10 :(

Step 1: Add New Tooltip Module

More on new. Today s Goals. CSCI 2910 Client/Server-Side Programming. Creating/Defining Objects. Creating/Defining Objects (continued)

JQUERYUI - SORTABLE. axis This option indicates an axis of movement "x" is horizontal, "y" is vertical. By default its value is false.

Basics of Web Technologies

AR0051: Digital Presentation Portfolio. AR0051 JQuery. Nord-Jan Vermeer Henry Kiksen. Challenge the future

Web Designer s Reference

Introduction to WEB PROGRAMMING

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

PHP,HTML5, CSS3, JQUERY SYLLABUS

CSS worksheet. JMC 105 Drake University

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

Dreamweaver CS4. Introduction. References :

ITEC447 Web Projects CHAPTER 9 FORMS 1

Web Development. With PHP. Web Development With PHP

write less. do more.

Designing the Home Page and Creating Additional Pages

710 Index Attributes, 127 action attribute, 263 assigning, bottom attribute, domain name attribute, 481 expiration date attribute, 480 8

2D1640 Grafik och Interaktionsprogrammering VT Good for working with different kinds of media (images, video clips, sounds, etc.

Webinar. The Lighthouse Studio Scripting Series. JavaScript Sawtooth Software, Inc.

CSE 154: Web Programming Midterm Exam Cheat Sheet HTML. Tags Used in the <head> Section. Tags Used in the <body> Section

jquery Basics jquery is a library of JavaScript functions which contains the following functions: HTML Element Selections

Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) What is JavaScript?

jquery Element & Attribute Selectors, Events, HTML Manipulation, & CSS Manipulation

ITS331 Information Technology I Laboratory

Design Document V2 ThingLink Startup

Web Designing Course

PIC 40A. Midterm 1 Review

COMP519 Web Programming Lecture 7: Cascading Style Sheets: Part 3 Handouts

Transcription:

Information Design Professor Danne Woo! infodesign.dannewoo.com! ARTS 269 Fall 2018 Friday 10:00PM 1:50PM I-Building 212

Interactive Data Viz Week 8: Data, the Web and Datavisual! Week 9: JavaScript and jquery! Week 10: JavaScript and APIs! Week 11: In Class Work! Week 12: JavaScript and D3! Week 13: In Class Work! Week 14: Final!

Web Programming Languages HTML Text and Content <h1>hello</h1> CSS Design and Style h1 { color: #ffffff; } JavaScript Animation and Interaction alert( Hi class );

JavaScript

Why JavaScript?

JavaScript and Data Load static data files Pull live data from API s Dynamically analyze data Dynamically visualize data Interact with the visualization

JavaScript Variables Arrays Functions Objects Push to HTML if statements Loops Events

JavaScript Noodling

JavaScript Variables var variablename; variablename = 10; alert(variablename);

JavaScript Variables

JavaScript Variables var numname = 10.52; var stringname = "Hi class"; var boolname = true;

JavaScript Arrays var arrayname = [37, 82, 95]; arrayname[1] = 82; arrayname.length = 3;

JavaScript Functions alert(content); console.log(content);

Internal JS

External JS

JavaScript Functions var greeting = "Hi class!"; function sayhello() { alert(greeting); } sayhello();

JavaScript Functions

JavaScript Functions function drawrectdiv(w, h, c) { document.write("<div style='width:" + w + "; height: " + h + "; background-color: " + c + ";'></div> "); } drawrectdiv("130px", "200px", "red");

JavaScript Objects var objectvarname = { name: 'Name', number: 20, boolean: true, array: ['value1', 'value2', 'value3'], fx: function() { function content; Parameters Methods } }

JavaScript Objects

JavaScript Objects var robot = { name: 'Tim', model: 1000, direction: 'right', speed: 5, walk: function() { function content; } }

JavaScript Objects var robotname = robot.name; var robotwalk = robot.walk(); console.log(robotname); // Tim robotwalk; // Will run walk function

JavaScript Objects

JavaScript Objects Constructor function robotarmy(name, model, weapon) { this.name = name; this.model = model; this.weapon = weapon; this.destroyhumans = function() { return this.weapon; } }

JavaScript Objects Constructor var t100 = new robotarmy('t-100', '100', 'Me'); var ironman = new robotarmy('iron Man', '1000', 'Missiles );

JavaScript Built in Objects Browser Objects: window current browser window or tab document current webpage location url or current page navigator information about browser screen devices display information Example: Get window width: window.innerwidth;

JavaScript Built in Objects Document Objects: title get current document title url returns current url of current document domain returns just the domain of current document write() method to write content to the document getelementbyid() method to get an HTML element by ID getelementbyclassname() method to get HTML element by class createelement() creates a new element Example: Write to webpage: document.write(); Add content to a ID: document.getelementbyid('idname').textcontent();

JavaScript Built in Objects String Objects: length get total number of characters touppercase() method to make text uppercase tolowercase() method to make text lowercase substring() method returns specific characters in string split() splits the string into an array at a certain point trim() removes space from start and end of string replace() allows you to replace characters Example: Split on space: var stringvar = "Hi class ; stringvar.split(" "); Returns an array: ["Hi", "class"];

JavaScript Built in Objects Math Objects: PI returns PI 3.14 round() rounds to nearest int ceil() rounds up floor() rounds down random() generates a random number between 0 and 1

JavaScript Built in Objects var today = new Date(); Tue Nov 10 2015 15:07:36 GMT-0500 (EST) Date Objects: getdate() getday() getfullyear() gethours() getmilliseconds()

JavaScript Decisions if (score >= 50) { document.write('you Passed!'); } else { document.write('try again '); } == is equal!= is not equal > is greater than < is less than === is definitely equal!== is definitely not equal >= is greater than or equal <= is less than or equal

JavaScript Decisions if (score >= 80 && score < 90) { } document.write('you got a B!'); && and or! logical not (takes a boolean and inverts it)

JavaScript Loops for (var i = 0; i < 10; i++) { } document.write(i);

JavaScript Loops var arraynum = [ 30, 82, 94, 72, 94 ]; for (var i = 0; i < arraynum.length; i++) { document.write("<div style='height: 20px; background-color: red; width: " + arraynum[i] + "px;'></div>"); }

JavaScript Events Window: load when the page has loaded resize when the page has been resized scroll when the user scrolls the page Keyboard: keydown when user presses a key (repeats while down) keyup when a user releases a key

JavaScript Events Mouse: click when the user clicks an element dblclick when a user double clicks an element mousedown when a user presses the mouse while over an element mouseup when a user release the mouse over an element mousemove when a use moves the mouse mouseover when a user hovers over an element mouseout when a user moves the mouse off an element

JavaScript Events Handling Events var el = document.getelementbyid('button'); el.addeventlistener('click', function() { }, true); alert('button clicked!');

jquery

jquery Selector Parameters jquery( 'li' ).addclass( 'important' ); jquery Object Method

jquery $( 'li' ).addclass( 'important' );

jquery HTML Elements: $( 'li' ).addclass( 'important' ); Class Name: $( '.classname' ).addclass( 'important' ); ID Name: $( '#idname' ).addclass( 'important' );

jquery Chaining $('#box').hide().delay(500).fadein(1500);

jquery Common Methods.html("<div id='box'></div>");.text("text goes here.");.replacewith("replaced text with this.");.remove();.hide();.show();.toggle();.append("add this text to the end of the existing text.");.prepend("add this text to the beginning of the existing text.");

jquery Common Stylistic Methods.addClass("Add this class to this element");.removeclass("remove this class from this element");.css("background-color", "red");.css("margin-left", "+=20");.css({ "background-color": "red", "font-family": "Helvetica" });

jquery Common Event Methods.on("click", function() { }); $(this).hide(); Popular Events: click, dblclick, mouseup, mousedown, mouseover, mousemove, mouseout, hover, resize, scroll, input, keydown, keyup, keypress

jquery Basic Effect Methods.delay(milliseconds);.slideUp("speed");.slideDown("speed");.slideToggle("speed");.fadeIn(milliseconds);.fadeOut(milliseconds);.fadeTo("speed", range from 0-1);.stop();

jquery Animating CSS Properties.animate({ // CSS styles go here. }, speed); $('.box').on('click', function() { }); $(this).animate({ 'opacity': '0.5', 'margin-left': '+=100' }, 1000);

jquery Checking if Page is Ready $('document').ready(function() { } // Your script goes here

jquery Documentation

In Class Assignment / Homework Create a simple abstract clock using JavaScript and jquery. Try not to use numbers but rather look at changing the appearance of HTML elements; look at using simple shapes, type, images and changing their size, color, location, opacity, rotation, etc. Tips: Create a function to display the time. Use the Date object to get the current time. Use setinterval(displaytimefunction, 1000) to update the time function every second.