the web wizard’s guide to dhtml and css

7
The Web Wizard’s Guide To DHTML and CSS Chapter 7 Using Dynamic Techniques

Upload: karina-holden

Post on 31-Dec-2015

15 views

Category:

Documents


0 download

DESCRIPTION

The Web Wizard’s Guide To DHTML and CSS. Chapter 7 Using Dynamic Techniques. Chapter Objectives. Modify font size and color dynamically Modify text border style and color dynamically Improve appearance and responsiveness of lists Work dynamically with images - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: The Web Wizard’s Guide To DHTML and CSS

The Web Wizard’s Guide To DHTML and CSS

Chapter 7

Using Dynamic Techniques

Page 2: The Web Wizard’s Guide To DHTML and CSS

Chapter Objectives

• Modify font size and color dynamically

• Modify text border style and color dynamically

• Improve appearance and responsiveness of lists

• Work dynamically with images

• Load external content in an inline frame

Page 3: The Web Wizard’s Guide To DHTML and CSS

Modifying Font Size and Color Dynamically

• Complex text effects without Flash• Any CSS font property can be changed• Style sheet sets initial color of text to white• <button

onclick="fadeText('fadingText',255,0,0);">• Specifies final color for div with id=“fadingText”• fadeIn() function makes small changes to size and

color every 35 milliseconds

Page 4: The Web Wizard’s Guide To DHTML and CSS

Modifying Border Style and Color Dynamically

• CSS values for border color, border style, border width, and background color

• document.getElementById('myText').style.borderColor = "red green yellow blue";

• Easily create ugly effects

Page 5: The Web Wizard’s Guide To DHTML and CSS

Creating Dynamic Lists

• Replace standard bullet with custom image

• Change image on mouseover

Page 6: The Web Wizard’s Guide To DHTML and CSS

Replacing Images with Dynamic HTML

• Old way - event handlers in <a> tag• New way - event handlers in any tag• Load all images in stacked divs• Change stacking order to show desired image• Combine with Dynamic List effect

Page 7: The Web Wizard’s Guide To DHTML and CSS

Using an Inline Frame to Load External Content

• <iframe> tag creates inline frame

• Can be positioned anywhere on the page

• Works in newer browsers only

• Change src attribute of iframe to load new content

• Simple link with target attribute also works