Click to See Complete Forum and Search --> : a minimizer
ptagi
07-06-2005, 09:26 AM
Hi,
forgive if this was already post, but i couldn't find it.
I have a layer with the head of a post. within this layer i have a inner where the actual post is. Now is my question, how can i hide the inner layer like start.be does with their buttons.
I however couldn't find out the source-code. I has to work for different browsers (IE, Netscape, Opera, ...)
If you guys can give me a start then i can play with it.
robertspeer
07-06-2005, 09:38 AM
You can manipulate the Visibility property of the <div> or <span> of the layer
see:
http://www.w3schools.com/dhtml/tryit.asp?filename=trydhtml_visibility
ptagi
07-06-2005, 09:45 AM
Yeah that I already knew, but how can I affect this by clicking on an image. I have to recognize the layersnames so i can hide the inner layer when i click it, but when i click it again, it has to be visible again.
Mayby by writing a javascript-function too?
robertspeer
07-06-2005, 11:25 AM
<div class='DivClass' id='DivId'>
<img src="whatever"
onClick="document.getElementById('DivId').style.visibility='hidden' ">
</div>
where DivId is the id of the layer
clicking on the whatever image will make it disappear
A1ien51
07-06-2005, 12:12 PM
funciton ShowHide(xSpan){
var objSpan = document.getElementById(xSpan);
objSpan.style.display = (objSpan.style.display == "none")?"block":"none";
}
call it
onclick="ShowHide('spanId')"
Eric
ptagi
07-06-2005, 03:24 PM
tx, style.display worked perfectly the way it should be. Also positioning my layeer to the right when it's a reply works fine.
Only it goes beyond the width of my table cell. Is there a possibility to fit the layer in the cell??
A1ien51
07-06-2005, 05:25 PM
try inline instead of block. Or assign the layer a width.
Eric
ptagi
07-06-2005, 06:45 PM
My tabels width is set to 100%.
With inline it still opens up the layer, but messes things up.
You can view it at wandelmee.be (http://www.wandelmee.be/wandelmee/zoekertje/zoekertje.php?id=1)
But that's when i push on the icon (first icon in the row)
It still have to fit when page loads.
I'm know PHP, but no Javascript.
By the way. I view with IE6 and Opera 8
ptagi
02-02-2007, 02:31 AM
Hi, some while ago i posted this and putted aside because I had other priority. Because our major users were using IE I haven't worked out other browsers.
I have the script running in IE, how can I determine it is firefox, netscape, mozilla, IE7, etc etc
Any help is greatly appreciated.