Menu

#2 getClipH under IE 5.5+

v2.xx
open
7
2002-09-20
2002-09-20
Anonymous
No

hello, i'm trying to use this (really interesting) set
of JavaScript modules but can't figure how to get div
height under IE5.5+
this getClipH function works well under both Netscape
(unix+Win32) but always returns 0 under IE...
is it a bug or am I doing things wrong ?

by the way, i didn't find any documentation to learn
how to use these modules... is there any draft or doc i
didn't find available ?

last question, i wrote ny my side some Perl/JavaScript
modules that handle trees (like win explorer tree
view)...
my code only worked under netscape/unix and i got pb
under others platforms/browsers.
are u planning to write or add a jsui-tree.js in your
packages ?
i'll try to rewrite my code with your modules
arch/specifications... if i get it to work, are you
interested in getting it ?

thx for reading.

here the code I wrote to test the jsui-common:
__CODE__
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML><HEAD><TITLE>test jsui</TITLE>
<SCRIPT SRC="/cgi-js/jsui-common.js"
LANGUAGE="JavaScript">

</SCRIPT>
</HEAD><BODY NOSAVE="1"><H1>test jsui</H1><SCRIPT
LANGUAGE="JavaScript">

//jsui.debug.add("");

var c = jsui.common.addCSS('idtestdiv1');
c.visibility = 'hidden';
c.bgColor = '#AABBCC';
d1 = jsui.common.addDIV('idtestdiv1');
d1.addHTML('<h1>toto1</h1><h1>lignedudessous</h1>');

c = jsui.common.addCSS('idtestdiv2');
c.visibility = 'hidden';
c.bgColor = '#CCBBAA';
d2 = jsui.common.addDIV('idtestdiv2');
d2.addHTML('<h1>toto2</h1>');

jsui.debug.add("/***/");
jsui.ns4.build();
jsui.init();
jsui.debug.add("/***/");

d1.moveTo(100,300);
d2.moveTo(d1.getLeft(),d1.getTop()+d1.getClipH());
d1.show();
d2.show();

for (i=0; i<jsui.common.divs.length; i++)
{
with (jsui.common.divs[i])
{

document.write(id+":getClipW="+getClipW()+"<br>");

document.write(id+":css.height="+css.height+"<br>");

document.write(id+":css.clip.height="+css.clip.height+"<br>");
}
}

for (i=0; i<jsui.debug.log.length; i++)
{
document.write(jsui.debug.log[i]+"<br>");
}

</SCRIPT>
</BODY></HTML>

Discussion

  • Robert Grimm

    Robert Grimm - 2002-09-20

    Logged In: YES
    user_id=251439

    I believe the problem you're experiencing is due to lack of
    setting the clipping originally and relying on the browser to
    size it to the text. Apparently NS sets the values for you, but
    IE leaves them empty so as to resize the DIVs if the content
    changes (that's a guess as I haven't tested it). I'll work on an
    update to the common module to allow checking of the width
    and height of an undefined clip DIV.

    Also, jsui.init() is intended to be run before any commands to
    JSUI are issued. jsui.init() also has two (optional) arguments,
    the first being the relative or absolute path to the location of
    the script files, and the second is a boolean to decide
    whether or not to alert the user in the case that JSUI refuses
    to load (incompatible browser for example). It also returns a
    boolean indicating whether JSUI is ready or if an error
    occurred during initialization, so its probably best if you
    enclose the JSUI commands within an if statement checking
    jsui.init().

    As for any official documentation, not yet (I'm a horrible doc
    writer and haven't found anyone that is up to tackling the
    task), which is why I try to provide examples for all the
    functionality of every module on the homepage (not really a
    homepage but an example page).

    About the tree-list, I was thinking of writing a module like that
    in the future, but before I start something like that I'm going to
    want to be finished with the window and taskbar modules.
    But yes I would be interested in receiving JSUI modules of
    any kind from outside sources. (of course giving them full
    credit)

    Thanks for your interest in JSUI =)
    -Faithful (Robert)

     
  • Robert Grimm

    Robert Grimm - 2002-09-20
    • priority: 5 --> 7
    • assigned_to: nobody --> faithful
     

Log in to post a comment.

MongoDB Logo MongoDB