Below you is the classic JTotW table of contents. If you move your mouse over one of the images, you'll hear a small "pop" and a you'll see the triangle in the image lite up. If you then proceed to click on the image, the whole thing will highlight and you will hear a small clicking sound. Eye candy? Yes, of course. But what would the web be without it? Essentially, this is an improvement on the September 30 dynamic image menus tip; an added bonus is that it works in Interenet Explorer (as well as Netscape 2.0).
<APPLET CODE = "dynimg.class" WIDTH = 148 HEIGHT = 27> <PARAM NAME = "inactive_image" VALUE = "this_week_inact.jpg"> <PARAM NAME = "active_image" VALUE = "this_week_act.jpg"> <PARAM NAME = "active_sound" VALUE = "drip.au"> <PARAM NAME = "clicked_image" VALUE = "this_week_selected.jpg"> <PARAM NAME = "clicked_sound" VALUE = "click.au"> <PARAM NAME = "bgcolor" VALUE = "#FFFFFF"> <PARAM NAME = "url" VALUE = "../this_week/index.html"> <PARAM NAME = "target" VALUE = "_self"> </APPLET>Most of these parameters are self explanatory. "inactive_image" is the name of the image file that is displayed when the mouse is not over the applet. In other words, it is displayed when the applet is waiting idly. "active_image" is the image that is displayed when the mouse is moved over the applet. In this example, the only difference between "active_image" and "inactive_image" is that the former has a light orange arrow pointing to it. The next parameter, "active_sound", contains the name of the sound file (must be AU format) that is played when the mouse is moved over the applet. Both "active_image" and "active_sound" are optional; if you don't want to include either of the two, then delete the entire parameter tag for each (leaving the parameter's VALUE empty will not suffice).
A note about image formats: Java has built in image capabilities, but only for GIF and JPEG images. If you include any other type of image format, the applet won't work.
The most important parameter is "url". It determines where the applet links to when it is clicked (actually when the mouse click is released). You do not need to put absolute URLs in the "url" paramter; just a relative URL. e.g. "/this_week/index.html". If you wish to target the URL to a specific window or frame, just include the name of the target in the "target" parameter. If you don't want to specifiy a target, just leave it at "_self".
Now how do you get this thing on your site? The only thing that you need from JTotW in the dynamic image class file, which you can download right here. Simply put the "dynimg.class" file your server and treat it like you would any other file. The file is only 3k, so your visitors should have almost no wait. What if your visitors don't have Java enabled browsers? Not a problem, just put the normal image and link in between the two applet tags. Here's an example: