Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

RevealTrans Filter - Page 3

August 23, 2002

First Things First: This is a DHTML event; thus you must be running MSIE4.0+ to see the effect. However, browsers that do not understand DHTML will happily ignore the commands without throwing errors, so feel free to use them at will.

You can find this tutorial, and all of its examples, online at
http://www.htmlgoodies.com/beyond/revealTransFilter.html.

You can download just the examples at http://www.htmlgoodies.com/wpg/.

Do you want a cool effect? Dig this! Figure 3.4 shows what this tutorial teaches you. Notice that the button says to click it for the image to go away. I clicked it and then captured the image as the image was disappearing. Inside of two seconds, it was gone. Really!

Figure 3.4

No eggs, thanks. . .

Better yet, you can also set it so that the image comes back.

What you're seeing there is the revealTrans() filter at work. Two separate JavaScripts are using the filter to make a SPAN disappear and then reappear. I'll show you the first one and then explain the second one, but only quickly. (It's just like the first one only backward. )

Make It Disappear

As I said previously, the image, "eggs.gif", itself doesn't disappear. The SPAN surrounding the image disappears. The image just goes with it. So, let's start with the SPAN and its image. The code looks like this:

<INPUT TYPE="button" VALUE="Go Away!" onClick="go();">
<SPAN ID=Egg1 Style="Visibility:visible;
Filter:revealTrans(duration=2);width:179;height:110">
<IMG SRC="eggs.gif">
</SPAN> 

The first line is a form button with the text "Go Away!" The button is there to act as a trigger for the function "go()". When clicked, the function fires.

The code is a basic SPAN surrounding the image flag displaying the eggs.gif. A NAME, Egg1, is given to the SPAN. That links it to the next JavaScript covered in the next paragraph. Also, inside the SPAN are some Style Sheet commands and the filter. Note that the visibility of the SPAN is set to "visible". That changes in the next script. Then comes the Filter:revealTrans(duration=2). You can probably guess that the 2 means two seconds for the effect. Then the height and width of the image are given so that the SPAN fits it perfectly.

Okay. Got the SPAN? Good. Now here is the script that does the dirty work:

<SCRIPT LANGUAGE="javascript">
function go() { 
Egg1.filters[0].Apply();
if (Egg1.style.visibility == "visible") 
{ 
Egg1.style.visibility = "hidden"; 
Egg1.filters.revealTrans.transition=12; 
} 
else 
{ 
Egg1.style.visibility = "visible"; 
Egg1.filters[0].transition=12; 
} 
Egg1.filters[0].Play(); 
} 
</SCRIPT> 

The script is pretty straightforward. When the function go() is triggered, the filter in Egg1 is applied. Remember that Egg1 is the SPAN. We gave it that name in the first script.

Then, if Egg1 is visible, set its value to "hidden" using transition number 12. Otherwise, make the SPAN Egg1 visible by using transition number 12.

Then play the transition! There's nothing to it!

Doing It Through Layers - Page 2
Beyond HTML Goodies
Transition Numbers - Page 4


Up to => Home / Authoring / DHTML / Beyond




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers