![]() |
Moving a Layer Around on the Page![]() ![]() ![]() ![]() ![]()
Moving a gives you the opportunity for some interesting, albeit superfluous, effects, such as curtains opening or graphics sliding into place
By moving a layer across the screen in increments, you achieve the same effect as a curtain revealing a stage.
<html><head> <title>Multiple Layers </title> </head> <script language="javascript"> <!-- function leftmove() document.layers["curtain "I.moveAbove(document, layers ["thetext']); while,(curtaihWidth > - 1) { <layer name=curtain bgcolor="red" top=0 left=0> <H1> Something is going. I am moving. Help!!! </H1> </layer> <layer name=thetext top=5 left=5> <P>Click<A href="tempor.htmI" fitle="Eveniet">me<A> mostly nothing may happen.</P> </layer>
leftmove(); </html> This page begins with a heading in a layer. Because it's the first element on the page, it automatically occupies the top-left position and fills the window from left to right. The red background makes the curtain opaque. The next layer is the body text. It is positioned at the top-left corner of the window below the heading text. To begin, get the windowWidth property from the current window, which enables you to know in how wide a space the curtain will be working, Then, begin with an offset value, which is decremented to move the curtain in a left-to-right motion using the moveTo method of the layer. After the layer is moved over, the offset is decremented by 10 pixels and the loop continues until it has traversed the screen. As an added safety to make sure the curtain moves out of the way, you also set the visibility property of the layer to hide to ensure that it's completely hidden from view on the page.
|
|
Domain NamesDHTML Document Object Model Features of Dynamic HTML HTML Versus DHTML Netscape's Vision of DHTML Microsoft Vision of DHTML Cascading Style Sheets(CSS) Inline Style Sheets Embedded Style for a Page Linked Cascading Style Sheet Text Specific Style AttributesCSS Attributes Assigning Classes Java Script Style Sheets(JSSS) Object Property Functions Methods
Creating Style Sheets with JSSS New JSSS Methods Working Layers Positioning the Layer Using More than One Layer Moving a Layer Around on the Page Events
The mouseOver and mouseOut Events The mouseMove Event The Keyboard Events The mouseDown and mouseUp Events The dragDrop Event Error Event Form Event The Script Tag Changing Text Color Inline Text Attribute Changes Text Dynamically Changing StylesExample of Dynamically Changing Style Dynamically Changing Content HTML Replacement Changing Text Content An Example of HTML Graphics ReplacementWeb DesignWeb HostingE Commerce |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |