As a general rule I would recommend thinking it twice before adding any functionality tot he core dynlayer. I understand that to some of the developers that "X" functionality is basic, something they need and thus it makes sense to have it as part of the dynlayer, but then some other developers won't need that.
However, this adds byte after byte to the dynlayer and we are already way bloated. Every time you think of new stuff please think of the way of making it an extension before touching the main file. I'd rather have a 10K dynlayer.js and then include 4 extension files for my project, because then I know some other user that only needs those 10k will have the option of including only one small file. I'm not saying I'm against this change, I am not, but I think it is a goog ocasion to make this recommendation. Matt Fair wrote: > I was playing around with something like this, though I haven't gotten > it to work yet. > DynLayer.prototype.setBgImage=function(path, repeat) { > this.bgImage=path; > this.bgImageRepeat=repeat||false; > if (this.css==null) return; > if (is.ns4) { > this.css.background.src=path; > if(!this.bgImageRepeat) > this.css.backgroundRepeat='no-repeat' > if (!path) this.setBgColor(this.getBgColor()); > } > else { > this.css.backgroundImage='url('+path+')'; > if(!this.bgImageRepeat) > this.css.backgroundRepeat='no-repeat' //?? > } > }; > Matt > > On Sun, 2001-11-11 at 02:28, Richard Bennett wrote: > >>Hi, >> >>>Do we have to still use the <layer> tags? >>> >>I'm not sure, but I think the fact we use layer tags for NS4 is the main >>reason why NS4 is reasonably stable using DynAPI2. >>If you have ever tried to debug a Dreamweaver page to work with NS4, you'll >>know about the crazy bugs NS4 comes up with when using DIV's with CSS >>applied. >> >> >>>I don't think there is a way to set it in the <layer> tag wether >>>the background image is repeating or not, it is just by default >>>repeating. >>> >>I put up a test here: >>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/~checkout~/dynapi/dynapi/test >>s/background_image.html >> >>It seems to me NS4 will work with no-repeat, but only when you apply >> >> >>background-image:url("http://developer.netscape.com:80/docs/manuals/communic >>ator/dynhtml/bluelite.gif"); >> >>not with >> >> >>layer-background-image:url("http://developer.netscape.com:80/docs/manuals/co >>mmunicator/dynhtml/bluelite.gif"); >> >>(Both applied as CSS to a DIV and a LAYER.) >>Very strange, I didn't even knew background-image worked in NS4 I always >>used both tags to cover all browsers. >> >>The basic idea behind your code seems ok to me, but remember, the way you >>set it up, the bgImageRepeat variable must be set before the dynLayer is >>created, and wont work with dynLayer.setBgImage(...). >>I guess we need true or false passed as second parameter of setBgImage too. >> >>Also, as of IE6, we can't use background images on layers that are to be >>animated, or they reload from the server constantly. This seems to be much >>more serious than IE5.5's ghost hourglass problem. >>It might even warrant setting an alert in pathanim (or wherever) to check if >>a layer has a background image, and warning the developer that that layer >>can't be animated. >>This issue could do with some more testing though - does it always happen, >>even if the background-image layer is nested inside another one, etc... >> >> >>>Should I just make the changes, test them, and put them right into the >>>cvs? >>> >>Personally I would set up a testpage (in /tests) , showing how the changes >>would work in practice, and put your changed methods in first thing after >>DynAPI.onload, that way they will overwrite the existing methods, and you >>can test your new code on the CVS version, without changing everything >>immediately. >> >>Cheers, >>Richard. >> >> >> >> >>----- Original Message ----- >>From: "Matt Fair" <[EMAIL PROTECTED]> >>To: <[EMAIL PROTECTED]> >>Sent: Saturday, November 10, 2001 6:51 PM >>Subject: [Dynapi-Dev] dynlayer.js bgImage bgImageRepeat >> >> >> >>>Do we have to still use the <layer> tags? I have been researching how >>>to set the background image of the layer and either have it repeat or >>>not. I don't think there is a way to set it in the <layer> tag wether >>>the background image is repeating or not, it is just by default >>>repeating. So I am thinking of this: >>>-have a variable this.bgImageRepeat=false by default >>>-for getOuterHTML() : >>>if (is.def) { >>> DynLayer.prototype.getOuterHTML=function() { >>>... >>> if (this.bgImage!=null) { >>> s+=' background-image:url('+this.bgImage+');'; >>> if (this.bgImageRepeat) s+=' background-repeat:repeat;'; >>> else s+=' background-repeat:no-repeat;'; >>> } >>> ... >>> }; >>>}else if (is.ns4) { >>> DynLayer.prototype.getOuterHTML=function() { >>> var s='\n<layer id="'+this.id+'"'; >>>... >>> >>> if (this.bgImage!=null && this.bgImageRepeat) >>>s+=' background="'+this.bgImage+'"'; >>> >>>... >>> s+='>'; >>> if(this.bgImage!=null && !this.bgImageRepeat) >>>s+='<img src="'+this.bgImage+'">'; >>> if (this.html!=null) s+=this.html; >>> for (var i=0; i<this.children.length; i++) >>>s+=this.children[i].getOuterHTML(); >>> s+='</layer>'; >>> return s; >>> }; >>>}; >>> >>> >>>What does anyone think? >>>Should I just make the changes, test them, and put them right into the >>>cvs? >>> >>>Matt >>> >>> >>>_______________________________________________ >>>Dynapi-Dev mailing list >>>[EMAIL PROTECTED] >>>http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/ >>> >>> >> >>_______________________________________________ >>Dynapi-Dev mailing list >>[EMAIL PROTECTED] >>http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/ >> > > > > _______________________________________________ > Dynapi-Dev mailing list > [EMAIL PROTECTED] > http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/ > > _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/