spacer
Yehuda Shiran August 23, 2000
Changing the Font Family on the Fly
Tips: August 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
HP to Microsoft: Thanks for Nothing
iPhone Remains Left Out as Android Scores Flash
The Year of Living the OpenSocial
Reflowing of the page is needed when the font family changes. Mouse over and out of the following page to see this effect. Transition is smoother when you mouse out of the side lines:

Mouse over this paragraph and see how the font family changes to Courier. Mouse out and see it changing to Arial. This is a good way to emphasize the paragraph currently being read. See how the browser reflows the page as if this paragraph was originally written with the current font family. Here is the HTML code that implements the above paragraph: Here is the HTML code that implements the above paragraph:

<SPAN STYLE="color:purple" onMouseOver="this.style.fontFamily = 'Courier'" 
 onMouseOut="this.style.fontFamily = 'Arial'">
 Mouse over this paragraph and see how the font family 
 changes to size Courier. Mouse out and see it changing 
 to Arial. This is a good way to emphasize the paragraph 
 currently being read. See how the browser reflows the page 
 as if this paragraph was originally written with the current 
 font family.
</SPAN>

Learn more about the subject in Column 66, Dynamic Styles.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Administering RBAC in PHP 5 CMS Framework · xref: Automatic Cross Referencing Script · Book Review: Content Rich
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Gateway Launches New Core i7-powered FX-Series Gaming PCs · Review: Lenovo ThinkPad SL300 · EBay, Alternative Site Holiday Resources for Sellers