Remote Control

Your applications have all kinds of information tucked away in hidden menus and dialog boxes, so why shouldn't your Web pages? They can. JavaScript already offers some of this functionality, but DHTML improves communication between JavaScript methods and the objects on a page. An object's properties (such as its visibility) can easily be controlled remotely. For instance, you can use a mouseover on one object to change the content or style of an object on the other side of the screen.

For this example, you'll want to remember the difference between a CSS .class (which can occur several times on a page) and a #ID (which can occur only once on a page and is used for scripts in which the object needs to be treated as a unique element).

This is heading 1

This is heading 2

 

<STYLE TYPE="text/css">
<!--
#header2 { font-family: Symbol; font-style:normal; color:pink; }
-->
</STYLE>
<h1 onmouseover="header2.style.fontFamily = 'Lucida';"
onmouseout="header2.style. fontFamily = 'Verdana';">
This is heading 1</h1></P>
<H2 ID=header2>This is heading 2</H2>

When the document loads, header2 is rendered in Symbol font. But when the mouse rolls over heading 1, heading 2 switches to the Lucida typeface.

css page break printing browser


Back To Top
© 1998 - 2014 psacake.com | My3C's

Version 7.0a | Advertise on this site