I added the isDirectChildOf() method because when retrieving the layer structure
from a given document, due to the fact that in IE all layers share one single
document, scanning the document would give you all layers as being in the same
level of the hierarchy. Therefore we need to know if, given two layers, the
second is a child of the first. This I did before NS6 was released, so there was
no support for it.
I can't test your code because NS6 refuses to run in my machine ( if it did, I
would have fixed the inline.js myself weeks ago ), but as long as it does the
job It should be OK.
Now into the second problem.
The code in updateValues suffers from the same problem: there is the IE part and
the NS part. The is.ns test will detect any Netscape, but the code is
implemented having NS4 in mind. The this.elm property in NS4 points to the
phisical Layer, that is the propietary LAYER element, and in order to get to the
background image we access its background.src property.
However, this property is no longer there in NS6, so the script generates an
error. You should replace the test with is.ns4 and add a is.ns5 that does the
updating by accessing the proper properties in Ns6. I'm not that fanmiliar with
the NS6 DOM yet, but it may be very similar to the explorer code and you might
be able to reuse most of the code.
Hope this is of any help
Matthew Shirey wrote:
> First, is this the right place to be discussing this? Alternatively, should
> it be moved over to the Dev list?
>
> Okay, I think I have located part of the NS 6 problem on inline layers but I
> need a little feedback. I found that the isDirectChildOf() method was ...
> behaving badly... in NS 6. The function was not returning true or false.
> It appears parentLayer is not a property of the div object in NS 6. It
> appears from my reading at w3.org that the property that I am looking for is
> parentNode and it seems to be structured much like the parentElement
> property which is what is used in IE. So I duplicated the method used for
> IE with some minor changes. Here's my new version of the isDirectChildOf()
> method. Can someone with a little more familiarity with the API and JS look
> at the code and tell me if it is solid or am I just smoking some funky
> weed...
>
> DynAPI.isDirectChildOf = function(l, parent) {
> if(is.ns4) {
> return (l.parentLayer == parent)
> }
> if(is.ns5) {
> for(var p=l.parentNode;p;p=p.parentNode) {
> tgName = String(p.tagName);
> if(tgName.toLowerCase()=='div') return p == parent;
> }
> return !parent.tagName;
> }
> for(var p=l.parentElement;p;p=p.parentElement)
> if(p.tagName.toLowerCase()=='div') return p==parent
> return !parent.tagName
> }
>
> Okay that seems to solve my first problem. The new problem is in the
> updateValues() method. This line:
>
> this.bgImage = this.elm.background.src!=""?this.elm.background.src:null
>
> produces this error:
>
> this.elm.background has no properties
>
> My brain is about dead on this today... so any input on this new problem
> would be much appreciated.
>
> Thanks,
>
> -- Matthew Shirey
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/mailman/listinfo/dynapi-help
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/dynapi-help