Solved

Layering of pics with ns

Posted on 1998-09-05
3
216 Views
Last Modified: 2010-04-09
is there a possibility to layer various pics above each other with the ns like it is possible with "z-index" attribut of ie ???
0
Comment
Question by:oburgis
3 Comments
 

Accepted Solution

by:
audrey090498 earned 100 total points
ID: 1837369
You can effectively layer images in NS using javascript like the one below. In this example, a drill bit punches through the background onMouseOver and reverses
onMouseOut. setTimeout allows you to adjust the delay between images to whatever you want.  Of course you can use the same script with single images and load them on top of one another with clicks or mouseOvers.

<head>
<script language="javascript">
<!--
drill = new Array();
for (i=0; i<=6; i++) {
drill[i] = new Image(); }
        drill[0].src = "nav6.gif";
        drill[1].src = "drill1.gif";
        drill[2].src = "drill2.gif";
        drill[3].src = "drill3.gif";
        drill[4].src = "drill4.gif";
        drill[5].src = "drill5.gif";
function drillout() {
setTimeout('document.drillanim.src = drill[0].src',0);
setTimeout('document.drillanim.src = drill[1].src',0);
setTimeout('document.drillanim.src = drill[2].src',75);
setTimeout('document.drillanim.src = drill[3].src',150);  
setTimeout('document.drillanim.src = drill[4].src',225);
setTimeout('document.drillanim.src = drill[5].src',300); }
function drillin() {
setTimeout('document.drillanim.src = drill[4].src',0);
setTimeout('document.drillanim.src = drill[3].src',75);
setTimeout('document.drillanim.src = drill[2].src',150);  
setTimeout('document.drillanim.src = drill[1].src',225);
setTimeout('document.drillanim.src = drill[0].src',300); }
//-->
</script>
</head>
<body>
<a href="#.html" onmouseover="(drillout())" onmouseout="(drillin())"><img name="drillanim" src="starts-without-drill.gif">

This is worth 100 points by the way.  Good luck.

0
 
LVL 2

Expert Comment

by:vendrig
ID: 1837370
When just talking about z-order... I don't know how to do it in MSIE4, but it's probably a similar approach as in NSNav4.
First of all you make layers that contain data (like images). Like <LAYER name="lay0" LEFT=150 TOP=10> <IMG src="image0.gif"> </LAYER>
Then you can set their visibility with the property VISIBILITY (values: "HIDE", "SHOW" or "INHERIT" to take same value as parent layer). SHOW is of course default.
Setting the z-order is done with the property Z-INDEX (value: positive integer, highest number on top of stack). If you don't specify anything, the order in the HTML file is used (last layer defined is on top).
For simple cases you can use BELOW and ABOVE properties, e.g. <LAYER name="lay1" BELOW="lay0"> means lay0 is below lay1.
You can approach the layers as an object (document.layers[0] and so on) in JavaScript, so that you can change all properties dynamically. Hint: use SHIFT-RELOAD when testing this stuff in your browser.
0
 

Author Comment

by:oburgis
ID: 1837371
Adjusted points to 100
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now