Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#175 getClip in Mozilla and Netscape7

open
nobody
5
2004-01-14
2004-01-14
Josep Maria
No

getClip returns [int,NaN,NaN,Nan] in Mozilla and
Netscape 7 where the last three alues are wrong.
This way, the setClip method works bad too, when we
pass it a null value in the array param.

We can avoid this adding this line in the getClip method
(/js/lib/dynapi/api/dynlayer.js):
if (is.ns5 || is.ns6) while (c.indexOf(",")>0) c=c.replace
(",","");

then the method will be these:
---------------------------
DynLayer.prototype.getClip=function() {
if (this.css==null || !this.css.clip) return
[0,0,0,0];
var c = this.css.clip;
if (c) {
if (is.ns4) return
[c.top,c.right,c.bottom,c.left];
if (c.indexOf("rect(")>-1) {
if (is.ns5 || is.ns6) while
(c.indexOf(",")>0) c=c.replace(",","");

        c=c.split\("rect\("\)\[1\].split\("\)"\)

[0].split("px");
for (var i in c) c[i]=parseInt
(c[i]);
return [c[0],c[1],c[2],c[3]];
}
else return [0,this.w,this.h,0];
}
};
---------------------------

and it works ok with Mozilla and Netscape 6 & 7.

:-)

Discussion

  • Josep Maria
    Josep Maria
    2004-01-14

    js/lib/dynapi/api/dynlayer.js

     
    Attachments