My Internet Explorer-only animated pushbuttons in issue 148 of PC Plus magazine brought howls of anguish from Netscape afficionados, so this month I'm making amends with altered images (or image substitution, to give it its proper title). By changing the source files of image tags 'in flight', you can create effects from simple 'rollover' animations to - yes - animated pushbuttons. What's more, it works with Netscape Navigator and Microsoft Internet Explorer.
|Image substitution is a bit of Dynamic HTML
which - amazingly - works in both the leading browsers (and in versions
earlier than 4.0, too). It involves changing the .src
(image file name) property of an object representing an <IMG>
tag, causing the browser to display a different image at the tag's screen
position, without reloading the entire page.
By doing this in conjunction with mouse-handling events such as onclick and onmouseover, you can create 'rollover' graphics which 'animate' when the mouse pointer moves over them, and buttons which 'light up' or 'pop out' when clicked. You can also create multi-image slide shows, and timer-controlled effects such as the 'video wall' at the top of this page.
Image substitution is very easy in Internet Explorer 4.0 (you just say something like 'MyPic.src="newimage.gif"), but to make it work with Netscape Navigator you have to use slightly more complex techniques. This is because Navigator doesn't let you reference <IMG> tag objects directly, and doesn't support onclick or onmouseover/out events on <IMG>s either. Luckily the workarounds aren't too difficult, and they also work with IE.
Internet Client SDK Is Dead, Long Live SiteBuilder Workshop (but watch your phone bill!).
However there is a major drawback - unlike the old SDK, the Workshop pages can't be downloaded in bulk for local browsing from your hard disk. Microsoft's excuse is that the pages are so 'dynamic' that you need to get the latest versions from the server each time (click here to view their excuse page), although another reason could be that they just haven't finished writing them yet. 'Snapshots' on CD are promised for some time in the future.
Until next month, happy authoring!