layers help

7 отговора 199 прегледа
#1

layers help

Имам следните 2 функции:

function hideElement(id) {
if (document.all) {
eval("document.all."+id+".style.display=\"none\";");
}
else {
eval("document.layers[\""+id+"\"].visibility = \"hidden\";");
}
}

function showElement(id) {
if (document.all) {
eval("document.all."+id+".style.display=\"block\";");
}
else {
eval("document.layers[\""+id+"\"].visibility = \"show\";");
}
}

И редовете:

<td id="fish"><a href="#" onMouseOver="hideElement('fish');" onMouseOut="showElement('fish');">element_1_2_2</a></td>
<td id="fis"><a href="#" onMouseOver="hideElement('fis');" onMouseOut="showElement('fis');">element_1_2_3</a></td>

Как е възможно под Netscape първото да работи, а второто да връща:

document.layers.fis has no properties.



И изобщо, това ли е правилният начин за layer-осване?

"Никоя армия не може да спре идея, чието време е дошло." - Виктор Юго
Отговор
в отговор на Dakota #2

Re: layers help

heh Dakota... ne se izlagai pich...
ne znam zashto parvoto raboti, ama ti shto reshi che kato na neshto slojish ID i to stava layer???

netscape layer moje, moje i div (moje bi i span), ama TD???

Just a genius[email protected]
[линк]
Отговор
в отговор на Blake #3

Re: layers help

uh az kakwi problemi sym imal s NS4 (iawno Dakota vizira NS 4 shtoto s NS 6 document.layer niama) kato naprimer edna programa na javascript raboti s komentary a bez komentari ne raboti =)
drug primer - w niakoi sluchai, za da razbere NS 4 che triabwa da sloji dadeni layers triabwashe da mu slagam fiktiwni prazni layers da se oswesti ... i drugi podobni ....

a shto se otnasia za <td id="ssss"> takowa neshto daje se uchudwam che moje da se podkara pod NS 4 =)

Napred naukata e slynce, koiato ... taka i ne me ogria
Отговор
в отговор на Blake #5

Re: layers help

Именно това е въпроса, защо веднъж работи, а втори път не...

"Никоя армия не може да спре идея, чието време е дошло." - Виктор Юго
Отговор
в отговор на Dakota #6

What are the Eight Layer Laws?

What are the Eight Layer Laws?

These are not really laws, of course, but just good sound advice for keeping yourself out of trouble when using layers. There used to be Nine Layer Laws, but we had a budget cut.

1. Never use more than a single parent layer if you want to nest layers. If you must use nested layers that are not fully specified in your stylesheet, make sure that you check frequently in Netscape4x.

2. Always put text into a table in the layer - table should be absolutely sized (in pixels and not %) and no larger than the layer, but nested tables within the main table can be set to a relative % size. This will prevent Netscape4x from 'reflowing' the text unexpectedly after a resize event.

3. Never put layers in tables. Netscape 4x will not properly render layers in tables.

4. Always use the Netscape Resize Fix on any page with layers or CSS styles.

5. Do not expect absolutely positioned layers to remain aligned with centered tables or page content as the browser window resizes or the resolution changes. There are Extensions available that can do this dynamically.

6. Don't try to put scrollbars in layers (with overflow property) - use a DHTML scroller or the Project Seven IFRAME technique instead, to embed a popup in the IFRAME specifically for users of Netscape 4.x.

7. Never name a layer the same as an image - every layer should have its own name unique from anything else on the page (in fact, you should never have any two page elements with the same name!).

8. Don't apply events/behaviors directly to layers. They will not work cross-browser. Apply them to content in the layer (links or images) rather than to the layer itself.

-- Murray R. Summers / Kindler Chase

Отговор
в отговор на Dakota #7

NS layers

1. V netscape visibility e 'hide'|'show' a ne 'visible'|'hidden'
2. NS4 razpoznava <div id=x style="position: absolute"...> kato <layer....> tag. Tova s <td..> mi se vijda malko stranno da raboti (ne sum go testval, no shtom kazvash)
3. Vij [линк] - tiq momcheta razkazvat igrata na NS4. Mnogo polezen tutorial, ima dosta primeri.Shte ti pomogne mnogo

Отговор
в отговор на pink #8

Re: NS layers

mi i 'visible' i 'hidden' si rabotiat, ako stava vapros za DIV. Samo deto predi tova triabva da si go opisal v <style> bloka

Just a genius[email protected]
[линк]
Отговор