JavaScript IV Robin Burke ECT 270. Outline Final project reminder Style review Manipulating style Special effect examples.

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

Introduction to HTML & CSS
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Cascading Style Sheets (CSS). Cascading Style Sheets With the explosive growth of the World Wide Web, designers and programmers quickly explored and reached.
Cascading Style Sheets
Dynamic HTML Netscape Navigator (NN) 6.0 & Internet Explorer (IE) 5.0.
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
Macromedia Dreamweaver 4 Advanced Level Course. Add Rollovers Rollovers or mouseovers are possibly the most popular effects used in designing Web pages.
CM143 Week 4 Introducing CSS. Cascading Style Sheets A definition for the style in which an element of the webpage will be displayed Border width, colour,
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
DHTML & ALPHABET SOUP Sp.772 spring A combination Html 4.0 Javascript The document object model (DOM) -- accessing individual document objects Cascading.
Using Cascading Style Sheets (CSS) Dept. of Computer Science and Computer Information CSCI N-100.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
© 2012 Adobe Systems Incorporated. All Rights Reserved. LEARNING THE LANGUAGE OF THE WEB INTRODUCTION TO HTML AND CSS.
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.
HTML & CSS A brief introduction. OUTLINE 1.What is HTML? 2.What is CSS? 3.How are they used together? 4.Troubleshooting/Common problems 5.More resources.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
HTML - Quiz #2 Attendance CODE:
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
© Cheltenham Computer Training 2001 Macromedia Dreamweaver 4 - Slide No 1 Macromedia Dreamweaver 4 Advanced Level Course.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
DHTML Positioning and Layout. What is DHTML? HTML and xHTML CSS JavaScript or VBScript.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
CHAPTER 10 Formatting Tables and Forms. Using Tables the Right Way  HTML and XHTML have a LOT of tags dedicated to building a table  If you have only.
Creating an Animated Web Page
Working with Objects Creating a Dynamic Web Page.
CITS1231 Web Technologies JavaScript and Document Object Model.
XP Tutorial 4 New Perspectives on JavaScript, Comprehensive1 Working with Objects Creating an Animated Web Page.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 7.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
DHTML - Introduction Chapter Introduction to DHTML, the DOM, JS review.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
Interactive Client-Side Technologies MMIS 656 Web Design Technologies Acknowledgements: Estrella, S. (2003). The Web Wizard’s Guide to DHTML and CSS.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
JavaScript IV ECT 270 Robin Burke. Outline DOM JS document model review W3C DOM.
DHTML: Working with Objects Creating a Dynamic Web Page.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
JavaScript III ECT 270 Robin Burke. Outline Form validation Regular expressions DOM JS document model review W3C DOM Cross-browser scripting Style.
Advanced Web Development Instructor: Thomas Bombach.
Cascading Style Sheets Robin Burke ECT 360. Outline Midterm CSS CSS selection Positioning SVG Final project.
Web Development 101 Presented by John Valance
DHTML. What is it? Dynamic HTML. Not a standard unlike HTML or Java It is a term applied by both Netscape and Microsoft to a collection of technologies.
Cascading Style Sheets
Introduction to CSS. Why CSS? CSS Provides Efficiency in Design and Updates CSS relatively easy to use Can give you more flexibility and control Faster.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
JavaScript V Robin Burke ECT 270. Outline Manipulating style Special effect examples.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 6.
Project 7: Exploring DHTML Essentials for Design JavaScript Level Two Michael Brooks.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
JavaScript and Ajax (JavaScript Dynamic HTML (DHTML)) Week 7 Web site:
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
CSCI 3100 Tutorial 5 JavaScript & Ajax Jichuan Zeng Department of Computer Science and Engineering The Chinese University of Hong.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Cascading Style Sheets Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
DHTML.
DOM Robin Burke ECT 360.
Cascading Style Sheets - Building a stylesheet
Cascading Style Sheets - Building a stylesheet
Web Programming and Design
Presentation transcript:

JavaScript IV Robin Burke ECT 270

Outline Final project reminder Style review Manipulating style Special effect examples

Final project Grading rubric fill in for your team bring to class next week

Quick review of style Introduced in the context of CSS but can be embedded in particular tags Style is a specification language for layout Specify colors font properties position

Style Syntax element-name {style-name1: property1; style-name2: property2} h1 { font-weight: bold; font-family: sans-serif; } Or embedded style Title here

Example style sheet for course site

Manipulating style We can manipulate style dynamically just like other element properties Each element has an associated style object setting the properties of this object change the element's displayed style editing embedded style

Note CSS "-" is style name separator font-family: Arial, sans-serif JavaScript "-" is subtraction operator style names use lowerUpper syntax font-family becomes fontFamily elem.style.fontFamily = "Arial, sans-serif" Netscape style property is missing from "schismatic" Netscape versions (4-5) instead elem.fontFamily =...

Cross-browser solution StyleAPI file if (document.layers) isNS = true; if (document.all) isIE = true; function setFontFamily (elem, family) { if (isIE) elem.style.fontFamily = family; else if (isNS) elem.fontFamily = family; }

Examples change font color change font family button example from 10/27

Manipulating position and boundary Position is another style property also boundary via clip property Many effects possible animation drop down menus

Implementation Relevant DOM properties elem.style.left elem.style.top Problem these are string values with units "5 px", "10 in" Solution IE-specific elem.style.pixelLeft integer valued use text processing parseInt to get value value + "px" to set

Animation Repeated display with transformation How to achieve repeat? looping is bad prevent the user from interacting with browser better solution use event mechanism setTimeout(fn, delay) the function will be called when the delay has passed

Animation examples linear shift path animation snowflakes

Controlling display Visibility elem.style.visibility = "hidden"; or "visible", "inherit" element takes up space but can't be seen elem.style.display = "none"; or "" element takes up no space

Controlling display, cont'd Clipping Can set the size of the container smaller than its contents elem.style.clip = rect(x1, y1, x2, y2);

Controlling display, cont'd Clipping creates a viewing area can't access the rest of the image or contents To shrink viewing area, but allow access change size of the element set overflow property

What to do with excess Use overflow property

Example scrollable HTML area

Drop-down effects Clipping can be used for drop-down menus purely in HTML no images

Before clipping After clipping

Note Book's DOM API is not needed with Mozilla Book's code is really ugly mine is better

CSS and JavaScript Discussed how to modify style of a single element one property at a time CSS lets us have classes We can modify an elements class at run-time elem.className=

Example rollover expandable outline

Modifying a style associated with a class Stylesheets themselves are objects Accessed via styleSheets[] array Each style sheet has an array of rules cssRules[] (NS) rules [] (IE) We can inspect and modify the styles

Example rollover

Next week Grading sheet Be here at 5:45 pm for presentations stay to hear your classmates