tailieunhanh - Javascript bible_ Chapter 12

Tham khảo sách 'javascript bible_ chapter 12', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Images and Dynamic HTML The previous eight lessons have been intensive covering a lot of ground for both programming concepts and JavaScript. Now it s time to apply what you ve learned to learn some more. I will cover two areas here. First I show you how to implement the ever-popular mouse rollover where images swap when the user rolls the cursor around the screen. Finally I introduce you to concepts surrounding scripted control of Dynamic HTML in the level 4 browsers and the Netscape LAYER tag in particular. The Image Object One of the objects contained by the document is the image object. Unfortunately this object is not available in all scriptable browsers. You can script it in Navigator 3 and later or Internet Explorer 4. Therefore everything you learn here about the image object won t apply to Navigator 2 or Internet Explorer 3 for Windows. Because a document can have more than one image image object references are stored in the object model as an array. You can therefore reference an image by array index or image name n Each of the IMG tag s attributes is accessible to JavaScript as a property of the image object. No mouse-related event handlers are affiliated with the image object although they are in Internet Explorer 4 . If you want to make an image a clickable item surround it with a link and set the image s border to zero or attach a client-side image map to it. The combination of a link and image is how you make a clickable image button the image type of form input element is not a scriptable object . Interchangeable images When the image became an object with the release of Navigator 3 it did so with a special behavior a script could In This Chapter How to precache images How to swap images for mouse rollovers What you can do with Dynamic HTML and scripting 2 Part II JavaScript Tutorial change the image occupying the rectangular space already occupied by an image. This was one of the first examples of dynamically .

TỪ KHÓA LIÊN QUAN