Monday, October 26, 2009

About " layer " the solution of the problem of fixed position

One.  The problem that often appears

Inserted a layer again when your form chooses be placed in the middle (insert a method 1: Object-&gtdraw Layer) when (800*600) , once resolution greatens, the window is the largest after changing, layer with respect to amlposition, and if use bill of fare (insert a method 2: When Insert->Layer) inserts a layer, this layer is met as relative as its ranking element fixed position, but once be in Dreamweaver,moved it with mobile tool, it can become absolutely fixed position immediately, won't locate relatively with ranking element again.

2.  Thought:

The layer that enters through buy of Object face plate is the layer of absolutely fixed position, this top left corner that locates those who point to is a layer absolutely and the wrong department with browser in-house window, coping is apart from, code writes a law mediumly is Left and Top.
The layer that enters through menu buy is the layer of relative fixed position, the distance of this ranking element that locates those who point to is layer and it relatively (the top left corner of its ranking element) , because there is the property of Left and Top no longer in this Div, so the browser is its position surely the ranking element with it is identical

(sum up one: The Left that wants take out layer only and Top attribute can locate relatively! )

Exemple graph:


3.  Thorough thought:

The layer had located relatively now, but just cannot satisfy a requirement completely still so, cannot get form set because of a lot of moment accurate in that way, can make form very troublesome otherwise, carry code very greatly very big.
If above a layer is opposite the redo on the foundation of the layer that says made relative fixed position it locates relatively, do not solve a problem?
This involved father layer and child the problem of the layer (because it is the foundation of the layer, can see in the tutorial on book and net, elaborate no longer here) , father layer chooses location relative to Yu Mou, and child layer photograph locates to father layer, the relative fixed position that can obtain a layer this target

4.  Provide system to make (introduce the simplest method only, ripe to code friend is OK the hand knocks) :

Form is inserted inside preexistence page (can set be placed in the middle, form with respect to be placed in the middle, otherwise almost insignificant) , the mouse is nodded inside some unit division, let cursor be blinked here, insert a layer through menu next, this layer located relative to as unit as this case. After inserting a layer, do not move it, and also do not move forever, but the size that can change it, change its Gao Yukuan into "0" for instance, let it affect your editor to other content no longer, otherwise, absolutely fixed position was become after the Left of this layer and Top attribute appear, you are OK after becoming absolutely fixed position the Left it and Top attribute take out, restored to locate relatively. After becoming "0" , sometimes child the layer will be invisible, can press [F11] key nods it to restore an editor.
Cursor is blinked inside this layer now, repass menu is inserted child layer, at this moment child layer and father layer jackknife, you can move at will it, no matter how be moved, it is opposite locate with father layer.
Good, the layer of a relative fixed position (child layer) had been done, you can add content at will inside, also can change all property such as its dimension, position, setting, but do not use Left and Top property, because it is opposite,locate at the top left corner of father layer.

Father gives out below layer and child layer the attribute face plate in Dreamweaver:

Father layer:


Child layer:


5.  Skill:

Insert a form first, amid inserts father layer in an unit case, can decide it a bit smallier, e.g. 20 elephants element element of wide, 10 elephants is tall, such it won't cover the link below, also do not affect child the relative fixed position of the layer.
If want to use form of broad definition of 778 elephants element, in division of the first when can insert father layer to form the first unit, can be in so father layer is inserted after all layers are made! Ripe to code friend is OK the hand knocks father layer and need not be adjusted again child the position of the layer.  

No comments:

Post a Comment