I need help on how to get the value of the "clip" object in a layer("div") on Netscape4. When I use eval('document.layers[\'layer1\'].clip') the value is "[object Rect]". What I need is the rect value. e.g. rect(0 10 0 10).
Thanks
[Edited by ej on 07-03-2000 at 12:42 AM]
Michel
07-03-2000, 06:58 AM
In NN you need to specify which side (i.e. top, right, bottom, left) of the rect that you´re interested in.
Thus, to obtain the bottom value of the rect you´d go:
document.layers.layer_name.clip.bottom
You can try it with the sample code below.
<HTML>
<HEAD>
<SCRIPT>
function init() {
if(document.all)
alert(document.all.x.style.clip);
if(document.layers)
alert(document.layers.x.clip.left);
}
</SCRIPT>
</HEAD>
<BODY onLoad="init()">
<DIV ID="x" STYLE="position:absolute; width:100px; height:20px; clip:rect(2px, 75px, 15px, 5px)">TEST OF CLIP</DIV>
</BODY>
</HTML>
</BODY>
</HTML>
It´s cross browser, as you specified in your previous post.
[Edited by Michel on 07-03-2000 at 01:07 AM]
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.