tailieunhanh - JavaScript Bible, Gold Edition part 104

JavaScript Bible, Gold Edition part 104. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | 878 Part III Document Objects Reference As a demonstration of a reveal visual effect which you can carry out more simply in IE4 Windows via a transition filter the revealClip function establishes beginning clip values at the midpoints of the width and height of the layer. Then the setInterval method loops through stepClip until the clipping rectangle dimensions match those of the layer. Listing 31-15 Adjusting Layer Clip Properties W3C HTML HEAD TITLE Layer Clip TITLE SCRIPT LANGUAGE JavaScript var origLayerWidth 0 var origLayerHeight 0 var currTop currRight currBottom currLeft function init origLayerWidth parseInt display . origLayerHeight parseInt display . currTop 0 currRight origLayerWidth currBottom origLayerHeight currLeft 0 showValues function setClip field var val parseInt switch case top currTop val break case right currRight val break case bottom currBottom val break case left currLeft val break case width currRight currLeft val break case height currBottom currTop val break adjustClip showValues function adjustClip display . rect currTop px currRight px currBottom px currLeft px Chapter 31 PositionedObjects 879 function showValues var form 0 currTop currRight currBottom currLeft currRight - currLeft currBottom - currTop var intervalID function revealClip var midWidth origLayerWidth 2 var midHeight origLayerHeight 2 currTop midHeight currBottom midHeight currRight midWidth currLeft midWidth intervalID setInterval stepClip 1 function stepClip var widthDone false var heightDone false if currLeft 0 currLeft -2 currRight 2 else widthDone true if currTop 0 currTop -1 currBottom 1 else heightDone true adjustClip showValues if widthDone heightDone clearlnterval intervallD SCRIPT HEAD BODY onLoad init

TỪ KHÓA LIÊN QUAN