|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
Figure 26.14 shows what the document looks like when the Blur filter effect is selected. This is implemented by using the onClick method of one of the buttons, as shown here: <INPUT CLASS=clsbtn VALUE="Blur" TYPE=BUTTON NAME=BLUR onClick="theImg.style.filter = blur(direction=45,strength=15,add=0,enabled=1); progress.innerText = explanatory text…;"> The different attributes of this <INPUT> tag do the following:
A number of filter effects are possible. It is even possible to combine the effects of more than one filter within a given region, or to apply a filter and animate it through JavaScript. Figure 26.15 shows a snapshot of an animated sine wave filter. This is achieved by applying the Wave filter, and then dynamically changing its parameters with a JavaScript, as shown in this code excerpt:
function animatwav() { if (wavable) { wavphase = (wavphase + 10) % 100; if (theImg.style.filter == wave(freq=4,strength=8,phase=0, ⇒lightstrength=25,add=1,enabled=1)") { theImg.filters[0].phase = wavphase; } window.setTimeout(animatwav()", 0400, JavaScript"); } } Microsofts ScriptletsWith version 4 of Internet Explorer, Microsoft also introduced another new technology known as Scriptlets. Microsoft calls Scriptlets components for the Web. Although not technically a part of Dynamic HTML, Scriptlets enable you to create small, reusable Web applications that can be used in any Web page. Scriptlets are created using HTML, scripting, and Dynamic HTML. To include them in an HTML document, use the <OBJECT> tag. What is meant by Web component? A software component is a self-contained piece of software designed to be used within a container application through a clearly defined interface. ActiveX Controls and Java applets represent two examples of Web objects that act as components within a browser. Until now, it has been possible to obtain some component functionality with HTML scripting by using the SRC attribute of the HTML <SCRIPT> tag. You could also achieve some measure of reuse either by making use of server-side includes or by simply cutting and pasting from one document to another. Microsofts Scriptlets add more complete component architecture for reusing scripted HTML documents and applications within other documents. Using Scriptlets as components in your HTML documents offers the following benefits:
Creating ScriptletsScriptlets are created like any other HTML document, with HTML and scripts. Scriptlet properties and methods are made accessible to containing HTML documents by prefacing them with public. For instance, if the following appears in the Scriptlet: <SCRIPT LANGUAGE=JAVASCRIPT> public_Value = Hello; function public_myFunction(par1,par2,…) { ... } </SCRIPT> and if the Scriptlet is included in an HTML document with <OBJECT ID="MyScriptlet">, the property and method shown in the preceding code can be accessed using this: MyScriptlet.Value = Goodbye; x = MyScriptlet.myFunction();
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |