From: Pascal B. <pa...@dy...> - 2000-10-31 21:13:30
|
Sorry for mailing so much into this list :-) but just looked at the setClip() some more and as I see it the clip() is always the same as the top;left;width and height values? then why use it? Only Netscape needs the values set, so for IE we could totally skip the setClip() method. IF the setClip() can be used in IE to set some other sort of clipping on/off (not sure what) then we could make another function that is called for setSize() methods (setWidth,setHeight) which does NOT call the old setclip, but a simple call for Netscape (making sure bottom,right,left and top values are set correctly). This seems to speed up things ALOT, here's another hack at the function: DynLayer.prototype.setClip=function(clip) { if (!this.created || is.ie || is.ns5) return var c=this.css.clip c.top=clip[0]||0 c.right=clip[1]||this.w c.bottom=clip[2]||this.h c.left=clip[3]||0 } For a function that is, in my opinion, rarely used it takes up way to much initialisation time.. with the above code I got a speed increase of 50% on 300 simple dynlayers (in a for-loop) that's on a P3 600, so not sure what other machines would do, and/or if IE4 behaves nicely with this code. Pascal Bestebroer pa...@dy... http://www.dynamic-core.net |