Starlite's Blog
I want to write about all sorts of subjects; I like to share conversations with others.
March 22, 2006--2 more stat tricks

If you want to place a graphic over another, for example, if you want to put a butterfly on a flower in another graphic, you would want to put the second graphic right over the first, right?
It can be done using what is called "Z-Index".
You place your images as usual, and you add the Z-index.
If you look below, you will see I have two images; I have their distance from the left, and from the top; I also have "position:absolute" which is very important;
then, I have my Z-index. I put 3 for the first image, and 4 for the second.
I could have put 1 and 2, I suppose. I didn't want to take any changes. Sometimes the background is already counting as 1.
You will have fun with this. You can have a field, for example and you can add whatever you like to it.Try it and see.

<DIV align=center><IMG
style="Z-INDEX: 3; LEFT: 300px; POSITION: absolute; TOP: 30px"
src="your path" border=3> <IMG
style="Z-INDEX: 4; LEFT: 600px; POSITION: absolute; TOP: 30px"
src="your path"></DIV>




I have one other trick for you.
Yesterday, I gave you a filter that you can use to make a graphic disappear. There is another way of doing that without filters. You have to write this out, or copy and paste it and play with the numbers so you have it appearing and disappearing as quickly or as slowly as you want.
This is the script:

<SCRIPT language=vbscript>
Sub Window_OnLoad()
window.status="...a script by you..."
SetTimeOut "changes",2000
End Sub
Sub changes()
ClearTimeOut
pic.style.visibility="visible"

SetTimeOut "disappear", 5000
End Sub
Sub disappear()
ClearTimeOut
pic.style.visibility="hidden"
SetTimeOut "changes",3000
End Sub</SCRIPT>

So, you have placed a graphic as you normally would, and then you give it an ID; it will look like
this:

<DIV align=center><IMG id=pic style="VISIBILITY: hidden"
src="your path";></DIV>

The id=pic (that's what I chose); see how visibility=hidden; that's the way it will start.
Then you will add the VBScript as above, to make it work. If You change the numbers, check after
each one to see what happens.
One last thing I want to say here. You can do this as many times as you want; you can have 3 graphics if you want (or more), each with its ID=name; You would not repeat the whole VBScript; you would just add a line for each ID. For example, if my second graphic's ID was pic2, I would add pic2.style.vis. ..="visible", and the same for the "hidden" line. I would repeat this as often as I need to.
Also, I can apply this to my textbox, so I would have an ID for my textbox and add the appropriate lines again.

I told you before I am not an expert. When I was researching this script to see how it works, I asked myself how I could have things appearing and disappearing at different times. I tried different methods and have not yet found the answer. When I do, I'll let you know. If you do, please write to me and tell me about it.
Thanks.

Ciao for now.
2006-03-22 14:35:05 GMT


1