logo.jpg (4128 bytes)
Home
Main Page
Links
Classical
Popular
Programming
Shareware
Emulation
Opus
Gtr & Fl.
Concerto
Code
Status bar
Math
Perl
Base Address
Meta Script
DHTML
WSC
Programs
Markup
Clipboard

 

Dynamic HTML

Transitions, and innerText

Below is an example of using Transitional Filters and also changing the text of an item on a page, using the innerText property. You can see examples of this if you are using Microsoft Internet Explorer version 4 or later, on any of the links pages on this site. This will not work with Netscape Navigator, because it sucks.

	// Arrays hold the text that is used for the innerText property.
	var Desc = new Array(2);
	
	/* The first index holds the Major category, that is, Techno, or Various.
	 * The second index holds the actual message that is applyed to the
	 * innerText property.
 	 */
	Desc[0] = new Array(2);	
	Desc[1] = new Array(4);

	// Techno Link descriptions
	Desc[0][0] = "Deep house masta!";
	Desc[0][1] = "Techno MP3s";
	// Various Link descriptions
	Desc[1][0] = "Bjork rules!";
	Desc[1][1] = "Weezer kicks booty!";
	Desc[1][2] = "Super underrated goodness is The Rentals";
	Desc[1][3] = "More Weezer greatness!";

function RevealIt(subA, subB, ID)
{
	// Reference Document to write to.
	with (document.all(ID))
	{
		// Change the text of the page element.
		innerText = Desc[subA][subB];

		/* for the transitional filter to work the item must
		 * be Hidden, for the transition is from Hidden to visible
		 */
		if (style.visibility == "visible") { style.visibility = "hidden"; }

		/* if the Filter is playing from another event then
		 * Stop it. An error will occur if this is not done.
		 */
		if (filters[0].status == 2) { filters[0].Stop(); }

		// Apply the filter to the the Document's item
		filters[0].Apply();

		style.visibility = "visible";	// Make it visible

		/* Assign which transition to apply. This can be
		 * any Number from 0 to 23.
		 */
		filters.revealTrans.transition = 12;
	
		filters[0].Play();	// Run the filter.
	}
}

  With Internet Explorer 4.0 or later, nearly everything on an HTML page has an innerText property. There are many more where that came from, and if you want to learn about it I suggest that you look at Microsoft Developer's Online Library, and check out the Document Object Model. There you will also be able to look at the different types of Transitions there are, among other wonderful things.

 

hr.jpg (2075 bytes)

 

Aaron L. Stephanus Do YOU want YOUR choice of a FREE laptop ?