Introducing DHTML. Goals Understand the concept of DHTML as a tool for creating dynamic content Understand how to use DOM properties to make changes in.

Slides:



Advertisements
Similar presentations
Chapter 08: Adding Adding Interactivity Interactivity With With Behaviors Behaviors By Bill Bennett Associate Professor MSJC CIS MVC.
Advertisements

© Park University, 2006 Creating an Interactive Web Page with DHTML and JavaScript Park University.
Chapter 16 Dynamic HTML and Animation The Web Warrior Guide to Web Design Technologies.
Javascript Document Object Model. How to use JavaScript  JavaScript can be embedded into your html pages in a couple of ways  in elements in both and.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
ITM352 Javascript and Dynamic Web Pages: Client Side Processing.
DHTML - Introduction Introduction to DHTML, the DOM, JS review.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
INTRODUCTION TO DHTML. TOPICS TO BE DISCUSSED……….  Introduction Introduction  UsesUses  ComponentsComponents  Difference between HTML and DHTMLDifference.
Web engineering. Topic: DHTML Presented by: Shah Rukh Presented to: Sir Ahsan raza.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Chapter 19: Adding JavaScript
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Lesson 19. JavaScript errors Since JavaScript is an interpreted language, syntax errors will usually cause the script to fail. Both browsers will provide.
CS 215 Web Oriented Programming Review Dr. Orland Hoeber orland
CSCI N341: Client-Side Web Programming Copyright ©2004  Department of Computer & Information Science Advanced DHTML.
Adding User Interactivity – Lesson 51 Adding User Interactivity Lesson 5.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
CITS1231 Web Technologies JavaScript and Document Object Model.
Advanced DHTML.
Copyright ©2005  Department of Computer & Information Science Advanced DHTML & DOM: Manipulating Styles with JavaScript.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
JavaScript, Fourth Edition
DHTML - Introduction Chapter Introduction to DHTML, the DOM, JS review.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
Chapter 8 © 2001 by Addison Wesley Longman, Inc. 1 Chapter 8 Sebesta: Programming the World Wide Web.
Chapter 7: DHTML: Object Model and Collections CIS 275—Web Application Development for Business I.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 13 - Dynamic HTML: Object Model and Collections Outline 13.1 Introduction 13.2 Object Referencing.
Modified from Moseley ’s sli desWeb Applications Development. Lecture 3 Slide 1 Lecture 3: Dynamic Web Pages – Introduction to JavaScript Instructor: Dr.
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2 Revised by Dr. T. Tran for CSI3140.
JavaScript, Fourth Edition Chapter 4 Manipulating the Browser Object Model.
CSS1 Dynamic HTML Objects, Collections & Events. CSS2 Introduction Dynamic HTML treats HTML elements as objects. Element’s parameters can be treated as.
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
Active X – Mouse Events. Structured Graphics Control  Included in Internet Explorer v5.0  Add to page with the OBJECT tag  Accessible via scripting.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
Chapter 6 © 2014 by Pearson Education Introduction Def: A dynamic HTML document is one whose tag attributes, tag contents, or element style properties.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Lesson 30: JavaScript and DHTML Fundamentals. Objectives Define and contrast client-side and server-side technologies used to create dynamic content for.
Introduction to the World Wide Web & Internet CIS 101.
The Web Wizard’s Guide To DHTML and CSS Chapter 2 A Review of CSS2 and JavaScript.
Chapter 6 Murach's JavaScript and jQuery, C6© 2012, Mike Murach & Associates, Inc.Slide 1.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
Adding Interactivity Comp 140 Fall Web 2.0 Major change in internet usage –From mostly static pages Text Graphics Simple links –To new paradigm.
Chapter 6 Dynamic Documents with JavaScript. © 2006 Pearson Addison-Wesley. All rights reserved Introduction Def: A dynamic HTML document is.
1 Objects In JavaScript. 2 Types of Object in JavaScript Built-in objects User Defined Objects Browser Object Document Object Model.
The Web Wizard’s Guide To DHTML and CSS Chapter 2 A Review of CSS2 and JavaScript.
The Web Wizard’s Guide To JavaScript Chapter 4 Image Swapping.
Chapter 13: DHTML: Object Model and Collections CIS 275—Web Application Development for Business I.
COM621: Advanced Interactive Web Development Lecture 6 – JavaScript (cont.)
G046 – Lecture 2A Recognising Web-Technologies Mr C Johnston ICT Teacher
DHTML.
Project 1 Introduction to HTML.
Javascript and Dynamic Web Pages: Client Side Processing
Using DHTML to Enhance Web Pages
Week 4: Introduction to Javascript
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
14 A Brief Look at JavaScript and jQuery.
The Web Wizard’s Guide To JavaScript
Web Design and Development
JavaScript.
6.1 Introduction 6.2 Positioning Elements
Presentation transcript:

Introducing DHTML

Goals Understand the concept of DHTML as a tool for creating dynamic content Understand how to use DOM properties to make changes in the appearance of HTML objects Understand how to create and use objects not explicitly created by HTML

DHTML: Unlocking the Mystery DHTML is not HTML DHTML is not a programming language DHTML is a programming model for designing Web pages that incorporates: ◦ JavaScript ◦ DOM ◦ CSS ◦ HTML

DHTML vs. HTML HTML Static Limited I/O Little Interactivity DHTML Dynamic Changes elements with changes in the environment Relies heavily on interactivity

DHTML Rules of Thumb For use with 4.x versions of the browsers Some DHTML scripts can be browser- dependent: ◦ Some versions of image swapping ◦ Hover for anchor tags

Image Swapping Most common use of DHTML Changing an image’s HTML properties (specified in HTML script) by copying the properties of a DOM object (specified in a JavaScript) Tip: ◦ Always assign a name to images using the HTML … tag!

Image Swapping Example 1 Simplest approach to swapping Assigns a source value to an object which is a DOM reference to an object created in HTML Problem: New images need to be download from the Server

Image Swapping Example 2 Local download of images References the source of an existing object created via HTML

Image Swapping Example 3 Create a Stand-Alone DOM Object Create references to the sources of the new object

Image Swapping using Mouse Events We can modify different mouse events attached to DOM objects to perform image swaps: ◦ onMouseOver() ◦ onMouseOut() ◦ onMouseDown() ◦ onMouseUp()

Mouse Event Example 1 Same function as before Mouse events are attached to an HTML anchor tag (for universality)

Mouse Event Example 2 Pre-load images Create three images for each tag: ◦ MouseOver/MouseUp image ◦ MouseDown Image ◦ MouseOut Image Mouse events are attached to an HTML anchor tag (for universality)

Mouse Event Example 3 Same idea as before However, mouse events are attached to image objects Will only work in MSIE 4+ and Navigator 6

Mouse Event Example 4 Will only work in NN 3+ and IE 4+ Uses the Document.Images Property & the eval() function.

Slideshow Example Uses an HTML-set image placeholder Uses functions to increment or decrement based on array values

Animation Example Uses an HTML-set image placeholder “Animates” using a combination of a for loop and an if structure Uses the setInterval() and clearInterval() functions.

Questions?

Resources Harris, Andrew. N341 Lecture Notes. Heinle, Nick & Bill Peña, Designing with JavaScript: Creating Dynamic Web Pages, 2 nd Edition. O’Reilly (2002).