From: Kevin <ke...@ke...> - 2003-04-26 01:40:03
|
Sorry didn't send reply to the list. > > "Raymond Irving" <xw...@ya...> wrote: > > > Hi, > > > > > > When using setClass('whatever',true) you should always > > create dynlayer with width and height or 0. This is to > > prevent dynlayer from attempting to autosize the > > layer. I disagree the w & h should be defaulted to null in the constructor and not be touched until _assignElement. > > It was suggested once that we get the width and the > > height from the style of the layer, but that might not > > be a good thing to do as style sheets can use > > different values for width and height: > > > > width:100px; height:100px; > > width:100%; height:100%; > > width:100cm; height:100cm; A user/developer knowing that pixels are supported would use px in style sheets as in the same way lyr=new DynLayer('z',10,10,'100%',100%') wouldn't be expected to work in any case. > > If a layer's style width inside the style sheet was > > set to 100% then the dynlayer would report the wrong > > size, correct? > > > > Any thoughts on this? Should we document that users > > set the width and height to 0,0 when using style > > sheets? Or should we enable DynLayer.assignElement() > > to first check for a valid css width/height before > > calling getContentWidth/Height? Defaults as explained above. Then in assignElement: 1) call new methods getElmWidth() & getElmHeight() to satisfy the style sheet requirement then if the user/developer hasn't specified a style object or class 2) call getContentWidth() & getContentHeight() to satisfy the auto size requirement (single character DynLayers etc) - Kevin. > > > > -- > > Raymond Irving > > > > __________________________________________________ > > Do you Yahoo!? > > The New Yahoo! Search - Faster. Easier. Bingo > > http://search.yahoo.com > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Dynapi-Dev mailing list > > Dyn...@li... > > http://www.mail-archive.com/dyn...@li.../ > |
From: Raymond I. <xw...@ya...> - 2003-04-28 03:11:01
|
Kevin, Proposed DynLayer functions for use within assignElement(): p.getElmWidth = function(){ var w = parseInt(this.css.width); if(isNaN(w)) w=this.getContentWidth(); return w; }; p.getElmHeight = function(){ var h = parseInt(this.css.height); if(isNaN(h)) h=this.getContentWidth(); return h; }; while DynLayer._assignElement will now use: if (dlyr.html!=null && dlyr.html!='' && (dlyr.w==null || dlyr.h==null)) { var cw = (dlyr.w==null)? dlyr.getElmWidth() : null; var ch = (dlyr.h==null)? dlyr.getElmHeight() : null; dlyr.setSize(cw,ch); } Please run a performance test on this to see if it is ok. Any comments, suggestions? -- Raymond Irving --- Kevin <ke...@ke...> wrote: > > "Raymond Irving" <xw...@ya...> wrote: > > > > > Hi, > > > > > > > > > When using setClass('whatever',true) you should > always > > > create dynlayer with width and height or 0. This > is to > > > prevent dynlayer from attempting to autosize the > > > layer. > > I disagree the w & h should be defaulted to null in > the > constructor and not be touched until _assignElement. > > > > It was suggested once that we get the width and > the > > > height from the style of the layer, but that > might not > > > be a good thing to do as style sheets can use > > > different values for width and height: > > > > > > width:100px; height:100px; > > > width:100%; height:100%; > > > width:100cm; height:100cm; > > A user/developer knowing that pixels are supported > would use px in style sheets as in the same way > lyr=new DynLayer('z',10,10,'100%',100%') > wouldn't be expected to work in any case. > > > > If a layer's style width inside the style sheet > was > > > set to 100% then the dynlayer would report the > wrong > > > size, correct? > > > > > > Any thoughts on this? Should we document that > users > > > set the width and height to 0,0 when using style > > > sheets? Or should we enable > DynLayer.assignElement() > > > to first check for a valid css width/height > before > > > calling getContentWidth/Height? > > Defaults as explained above. Then in assignElement: > 1) call new methods getElmWidth() & getElmHeight() > to satisfy the style sheet requirement > then if the user/developer hasn't specified a style > object > or class > 2) call getContentWidth() & getContentHeight() to > satisfy > the auto size requirement (single character > DynLayers etc) > > - > Kevin. > > > > > > > -- > > > Raymond Irving > > > > > > > __________________________________________________ > > > Do you Yahoo!? > > > The New Yahoo! Search - Faster. Easier. Bingo > > > http://search.yahoo.com > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > Dynapi-Dev mailing list > > > Dyn...@li... > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://www.mail-archive.com/dyn...@li.../ __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Doug M. <do...@cr...> - 2003-04-28 03:49:58
|
what is this for? ----- Original Message ----- From: "Raymond Irving" <xw...@ya...> To: "Dynapi-Dev" <Dyn...@li...> Sent: Sunday, April 27, 2003 11:10 PM Subject: Re: [Dynapi-Dev] DynLayer and setClass() > Kevin, > > Proposed DynLayer functions for use within > assignElement(): > > p.getElmWidth = function(){ > var w = parseInt(this.css.width); > if(isNaN(w)) w=this.getContentWidth(); > return w; > }; > p.getElmHeight = function(){ > var h = parseInt(this.css.height); > if(isNaN(h)) h=this.getContentWidth(); > return h; > }; > > while DynLayer._assignElement will now use: > > if (dlyr.html!=null && dlyr.html!='' && (dlyr.w==null > || dlyr.h==null)) { > var cw = (dlyr.w==null)? dlyr.getElmWidth() : null; > var ch = (dlyr.h==null)? dlyr.getElmHeight() : null; > dlyr.setSize(cw,ch); > } > > > Please run a performance test on this to see if it is > ok. > > > Any comments, suggestions? > > > -- > Raymond Irving > > > --- Kevin <ke...@ke...> wrote: > > > > "Raymond Irving" <xw...@ya...> wrote: > > > > > > > Hi, > > > > > > > > > > > > When using setClass('whatever',true) you should > > always > > > > create dynlayer with width and height or 0. This > > is to > > > > prevent dynlayer from attempting to autosize the > > > > layer. > > > > I disagree the w & h should be defaulted to null in > > the > > constructor and not be touched until _assignElement. > > > > > > It was suggested once that we get the width and > > the > > > > height from the style of the layer, but that > > might not > > > > be a good thing to do as style sheets can use > > > > different values for width and height: > > > > > > > > width:100px; height:100px; > > > > width:100%; height:100%; > > > > width:100cm; height:100cm; > > > > A user/developer knowing that pixels are supported > > would use px in style sheets as in the same way > > lyr=new DynLayer('z',10,10,'100%',100%') > > wouldn't be expected to work in any case. > > > > > > If a layer's style width inside the style sheet > > was > > > > set to 100% then the dynlayer would report the > > wrong > > > > size, correct? > > > > > > > > Any thoughts on this? Should we document that > > users > > > > set the width and height to 0,0 when using style > > > > sheets? Or should we enable > > DynLayer.assignElement() > > > > to first check for a valid css width/height > > before > > > > calling getContentWidth/Height? > > > > Defaults as explained above. Then in assignElement: > > 1) call new methods getElmWidth() & getElmHeight() > > to satisfy the style sheet requirement > > then if the user/developer hasn't specified a style > > object > > or class > > 2) call getContentWidth() & getContentHeight() to > > satisfy > > the auto size requirement (single character > > DynLayers etc) > > > > - > > Kevin. > > > > > > > > > > -- > > > > Raymond Irving > > > > > > > > > > __________________________________________________ > > > > Do you Yahoo!? > > > > The New Yahoo! Search - Faster. Easier. Bingo > > > > http://search.yahoo.com > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This sf.net email is sponsored by:ThinkGeek > > > > Welcome to geek heaven. > > > > http://thinkgeek.com/sf > > > > _______________________________________________ > > > > Dynapi-Dev mailing list > > > > Dyn...@li... > > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Dynapi-Dev mailing list > > Dyn...@li... > > > http://www.mail-archive.com/dyn...@li.../ > > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://www.mail-archive.com/dyn...@li.../ > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 4/24/2003 |
From: Raymond I. <xw...@ya...> - 2003-04-28 14:34:45
|
--- Doug Melvin <do...@cr...> wrote: > what is this for? This will allow DynAPI to set the width/height of the layer if its was defined via a style sheet. For example, lyr.setClass('myclass',true) will cause dynapi to use "myclass" to setup the css properties for the DynLayer. If no css width/height were defined in the style sheet then the content width/height will be used as the dynlayer's width/height. -- Raymond Irving > ----- Original Message ----- > From: "Raymond Irving" <xw...@ya...> > To: "Dynapi-Dev" <Dyn...@li...> > Sent: Sunday, April 27, 2003 11:10 PM > Subject: Re: [Dynapi-Dev] DynLayer and setClass() > > > > Kevin, > > > > Proposed DynLayer functions for use within > > assignElement(): > > > > p.getElmWidth = function(){ > > var w = parseInt(this.css.width); > > if(isNaN(w)) w=this.getContentWidth(); > > return w; > > }; > > p.getElmHeight = function(){ > > var h = parseInt(this.css.height); > > if(isNaN(h)) h=this.getContentWidth(); > > return h; > > }; > > > > while DynLayer._assignElement will now use: > > > > if (dlyr.html!=null && dlyr.html!='' && > (dlyr.w==null > > || dlyr.h==null)) { > > var cw = (dlyr.w==null)? dlyr.getElmWidth() : > null; > > var ch = (dlyr.h==null)? dlyr.getElmHeight() : > null; > > dlyr.setSize(cw,ch); > > } > > > > > > Please run a performance test on this to see if it > is > > ok. > > > > > > Any comments, suggestions? > > > > > > -- > > Raymond Irving > > > > > > --- Kevin <ke...@ke...> wrote: > > > > > > "Raymond Irving" <xw...@ya...> wrote: > > > > > > > > > Hi, > > > > > > > > > > > > > > > When using setClass('whatever',true) you > should > > > always > > > > > create dynlayer with width and height or 0. > This > > > is to > > > > > prevent dynlayer from attempting to autosize > the > > > > > layer. > > > > > > I disagree the w & h should be defaulted to null > in > > > the > > > constructor and not be touched until > _assignElement. > > > > > > > > It was suggested once that we get the width > and > > > the > > > > > height from the style of the layer, but that > > > might not > > > > > be a good thing to do as style sheets can > use > > > > > different values for width and height: > > > > > > > > > > width:100px; height:100px; > > > > > width:100%; height:100%; > > > > > width:100cm; height:100cm; > > > > > > A user/developer knowing that pixels are > supported > > > would use px in style sheets as in the same way > > > lyr=new DynLayer('z',10,10,'100%',100%') > > > wouldn't be expected to work in any case. > > > > > > > > If a layer's style width inside the style > sheet > > > was > > > > > set to 100% then the dynlayer would report > the > > > wrong > > > > > size, correct? > > > > > > > > > > Any thoughts on this? Should we document > that > > > users > > > > > set the width and height to 0,0 when using > style > > > > > sheets? Or should we enable > > > DynLayer.assignElement() > > > > > to first check for a valid css width/height > > > before > > > > > calling getContentWidth/Height? > > > > > > Defaults as explained above. Then in > assignElement: > > > 1) call new methods getElmWidth() & > getElmHeight() > > > to satisfy the style sheet requirement > > > then if the user/developer hasn't specified a > style > > > object > > > or class > > > 2) call getContentWidth() & getContentHeight() > to > > > satisfy > > > the auto size requirement (single character > > > DynLayers etc) > > > > > > - > > > Kevin. > > > > > > > > > > > > > -- > > > > > Raymond Irving > > > > > > > > > > > > > > __________________________________________________ > > > > > Do you Yahoo!? > > > > > The New Yahoo! Search - Faster. Easier. > Bingo > > > > > http://search.yahoo.com > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > This sf.net email is sponsored by:ThinkGeek > > > > > Welcome to geek heaven. > > > > > http://thinkgeek.com/sf > > > > > > _______________________________________________ > > > > > Dynapi-Dev mailing list > > > > > Dyn...@li... > > > > > > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > Dynapi-Dev mailing list > > > Dyn...@li... > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > __________________________________ > > Do you Yahoo!? > > The New Yahoo! Search - Faster. Easier. Bingo. > > http://search.yahoo.com > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Dynapi-Dev mailing list > > Dyn...@li... > > > http://www.mail-archive.com/dyn...@li.../ > > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system > (http://www.grisoft.com). > Version: 6.0.476 / Virus Database: 273 - Release > Date: 4/24/2003 > > > === message truncated === __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Doug M. <do...@cr...> - 2003-04-28 17:24:40
|
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 4/24/03 |
From: Doug M. <do...@cr...> - 2003-04-28 18:14:46
|
sounds good to me ----- Original Message ----- From: "Raymond Irving" <xw...@ya...> To: "Dynapi-Dev" <Dyn...@li...> Sent: Monday, April 28, 2003 10:34 AM Subject: Re: [Dynapi-Dev] DynLayer and setClass() > > --- Doug Melvin <do...@cr...> wrote: > > what is this for? > > This will allow DynAPI to set the width/height of the > layer if its was defined via a style sheet. > > For example, lyr.setClass('myclass',true) will cause > dynapi to use "myclass" to setup the css properties > for the DynLayer. > > If no css width/height were defined in the style sheet > then the content width/height will be used as the > dynlayer's width/height. > > > -- > Raymond Irving > > > ----- Original Message ----- > > From: "Raymond Irving" <xw...@ya...> > > To: "Dynapi-Dev" <Dyn...@li...> > > Sent: Sunday, April 27, 2003 11:10 PM > > Subject: Re: [Dynapi-Dev] DynLayer and setClass() > > > > > > > Kevin, > > > > > > Proposed DynLayer functions for use within > > > assignElement(): > > > > > > p.getElmWidth = function(){ > > > var w = parseInt(this.css.width); > > > if(isNaN(w)) w=this.getContentWidth(); > > > return w; > > > }; > > > p.getElmHeight = function(){ > > > var h = parseInt(this.css.height); > > > if(isNaN(h)) h=this.getContentWidth(); > > > return h; > > > }; > > > > > > while DynLayer._assignElement will now use: > > > > > > if (dlyr.html!=null && dlyr.html!='' && > > (dlyr.w==null > > > || dlyr.h==null)) { > > > var cw = (dlyr.w==null)? dlyr.getElmWidth() : > > null; > > > var ch = (dlyr.h==null)? dlyr.getElmHeight() : > > null; > > > dlyr.setSize(cw,ch); > > > } > > > > > > > > > Please run a performance test on this to see if it > > is > > > ok. > > > > > > > > > Any comments, suggestions? > > > > > > > > > -- > > > Raymond Irving > > > > > > > > > --- Kevin <ke...@ke...> wrote: > > > > > > > > "Raymond Irving" <xw...@ya...> wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > When using setClass('whatever',true) you > > should > > > > always > > > > > > create dynlayer with width and height or 0. > > This > > > > is to > > > > > > prevent dynlayer from attempting to autosize > > the > > > > > > layer. > > > > > > > > I disagree the w & h should be defaulted to null > > in > > > > the > > > > constructor and not be touched until > > _assignElement. > > > > > > > > > > It was suggested once that we get the width > > and > > > > the > > > > > > height from the style of the layer, but that > > > > might not > > > > > > be a good thing to do as style sheets can > > use > > > > > > different values for width and height: > > > > > > > > > > > > width:100px; height:100px; > > > > > > width:100%; height:100%; > > > > > > width:100cm; height:100cm; > > > > > > > > A user/developer knowing that pixels are > > supported > > > > would use px in style sheets as in the same way > > > > lyr=new DynLayer('z',10,10,'100%',100%') > > > > wouldn't be expected to work in any case. > > > > > > > > > > If a layer's style width inside the style > > sheet > > > > was > > > > > > set to 100% then the dynlayer would report > > the > > > > wrong > > > > > > size, correct? > > > > > > > > > > > > Any thoughts on this? Should we document > > that > > > > users > > > > > > set the width and height to 0,0 when using > > style > > > > > > sheets? Or should we enable > > > > DynLayer.assignElement() > > > > > > to first check for a valid css width/height > > > > before > > > > > > calling getContentWidth/Height? > > > > > > > > Defaults as explained above. Then in > > assignElement: > > > > 1) call new methods getElmWidth() & > > getElmHeight() > > > > to satisfy the style sheet requirement > > > > then if the user/developer hasn't specified a > > style > > > > object > > > > or class > > > > 2) call getContentWidth() & getContentHeight() > > to > > > > satisfy > > > > the auto size requirement (single character > > > > DynLayers etc) > > > > > > > > - > > > > Kevin. > > > > > > > > > > > > > > > > -- > > > > > > Raymond Irving > > > > > > > > > > > > > > > > > > __________________________________________________ > > > > > > Do you Yahoo!? > > > > > > The New Yahoo! Search - Faster. Easier. > > Bingo > > > > > > http://search.yahoo.com > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > This sf.net email is sponsored by:ThinkGeek > > > > > > Welcome to geek heaven. > > > > > > http://thinkgeek.com/sf > > > > > > > > _______________________________________________ > > > > > > Dynapi-Dev mailing list > > > > > > Dyn...@li... > > > > > > > > > > > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This sf.net email is sponsored by:ThinkGeek > > > > Welcome to geek heaven. > > > > http://thinkgeek.com/sf > > > > _______________________________________________ > > > > Dynapi-Dev mailing list > > > > Dyn...@li... > > > > > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > > > > __________________________________ > > > Do you Yahoo!? > > > The New Yahoo! Search - Faster. Easier. Bingo. > > > http://search.yahoo.com > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > Dynapi-Dev mailing list > > > Dyn...@li... > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > > > > --- > > Outgoing mail is certified Virus Free. > > Checked by AVG anti-virus system > > (http://www.grisoft.com). > > Version: 6.0.476 / Virus Database: 273 - Release > > Date: 4/24/2003 > > > > > > > === message truncated === > > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://www.mail-archive.com/dyn...@li.../ > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 4/24/03 |
From: Kevin <ke...@ke...> - 2003-04-28 19:39:21
|
"Raymond Irving" <xw...@ya...> wrote: > Kevin, > > Proposed DynLayer functions for use within > assignElement(): > > p.getElmWidth = function(){ > var w = parseInt(this.css.width); > if(isNaN(w)) w=this.getContentWidth(); > return w; > }; > p.getElmHeight = function(){ > var h = parseInt(this.css.height); > if(isNaN(h)) h=this.getContentWidth(); > return h; > }; Not sure if it will work. Is getContentWidth/Height ever called and on what browsers did you see this? I had come up with a cross browser version: p.getElmWidth=function() { var r=this.elm, s=this.css; if(r) { s=s.clip||s; return s.width||r.offsetWidth; } else return null; }; p.getElmHeight=function() { var r=this.elm, s=this.css; if(r) { s=s.clip||s; return s.height||r.offsetHeight; } else return null; }; Unfortunately after HTML has been written the element has style anyway. So testing for no style value didn't work for me. We need something else. Perhaps: lyr=new DynL:ayer('a',100,100); setClass('redbg','auto'); will pull bgColor from the class 'redbg' and 'auto' to force getContentWidth/Height() (offsetWidth/Height) rather than looking at element style (width/height) which may contain valid size of 'a' or dynlayer size defined in class 'redbg'. - Kevin > while DynLayer._assignElement will now use: > > if (dlyr.html!=null && dlyr.html!='' && (dlyr.w==null > || dlyr.h==null)) { > var cw = (dlyr.w==null)? dlyr.getElmWidth() : null; > var ch = (dlyr.h==null)? dlyr.getElmHeight() : null; > dlyr.setSize(cw,ch); > } > > > Please run a performance test on this to see if it is > ok. > > > Any comments, suggestions? > > > -- > Raymond Irving > > > --- Kevin <ke...@ke...> wrote: > > > > "Raymond Irving" <xw...@ya...> wrote: > > > > > > > Hi, > > > > > > > > > > > > When using setClass('whatever',true) you should > > always > > > > create dynlayer with width and height or 0. This > > is to > > > > prevent dynlayer from attempting to autosize the > > > > layer. > > > > I disagree the w & h should be defaulted to null in > > the > > constructor and not be touched until _assignElement. > > > > > > It was suggested once that we get the width and > > the > > > > height from the style of the layer, but that > > might not > > > > be a good thing to do as style sheets can use > > > > different values for width and height: > > > > > > > > width:100px; height:100px; > > > > width:100%; height:100%; > > > > width:100cm; height:100cm; > > > > A user/developer knowing that pixels are supported > > would use px in style sheets as in the same way > > lyr=new DynLayer('z',10,10,'100%',100%') > > wouldn't be expected to work in any case. > > > > > > If a layer's style width inside the style sheet > > was > > > > set to 100% then the dynlayer would report the > > wrong > > > > size, correct? > > > > > > > > Any thoughts on this? Should we document that > > users > > > > set the width and height to 0,0 when using style > > > > sheets? Or should we enable > > DynLayer.assignElement() > > > > to first check for a valid css width/height > > before > > > > calling getContentWidth/Height? > > > > Defaults as explained above. Then in assignElement: > > 1) call new methods getElmWidth() & getElmHeight() > > to satisfy the style sheet requirement > > then if the user/developer hasn't specified a style > > object > > or class > > 2) call getContentWidth() & getContentHeight() to > > satisfy > > the auto size requirement (single character > > DynLayers etc) > > > > - > > Kevin. > > > > > > > > > > -- > > > > Raymond Irving > > > > > > > > > > __________________________________________________ > > > > Do you Yahoo!? > > > > The New Yahoo! Search - Faster. Easier. Bingo > > > > http://search.yahoo.com > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This sf.net email is sponsored by:ThinkGeek > > > > Welcome to geek heaven. > > > > http://thinkgeek.com/sf > > > > _______________________________________________ > > > > Dynapi-Dev mailing list > > > > Dyn...@li... > > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Dynapi-Dev mailing list > > Dyn...@li... > > > http://www.mail-archive.com/dyn...@li.../ > > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://www.mail-archive.com/dyn...@li.../ |
From: Raymond I. <xw...@ya...> - 2003-04-28 20:16:07
|
--- Kevin <ke...@ke...> wrote: > > "Raymond Irving" <xw...@ya...> wrote: > > > Kevin, > > > > Proposed DynLayer functions for use within > > assignElement(): > > > > p.getElmWidth = function(){ > > var w = parseInt(this.css.width); > > if(isNaN(w)) w=this.getContentWidth(); > > return w; > > }; > > p.getElmHeight = function(){ > > var h = parseInt(this.css.height); > > if(isNaN(h)) h=this.getContentWidth(); > > return h; > > }; > > Not sure if it will work. Is getContentWidth/Height > ever called and on what browsers did you see this? Whenever w==null and h==null then getContenWidth/Height is called to set the size of the layer. > I had come up with a cross browser version: > > p.getElmWidth=function() { > var r=this.elm, s=this.css; > if(r) { s=s.clip||s; return > s.width||r.offsetWidth; } > else return null; > }; > p.getElmHeight=function() { > var r=this.elm, s=this.css; > if(r) { s=s.clip||s; return > s.height||r.offsetHeight; } > else return null; > }; Will the above get the width of the layer when it's defined inside the style sheet? -- Raymond Irving > Unfortunately after HTML has been written the > element has style anyway. So testing for no style > value didn't work for me. We need something else. > Perhaps: > lyr=new DynL:ayer('a',100,100); > setClass('redbg','auto'); > will pull bgColor from the class 'redbg' and 'auto' > to > force getContentWidth/Height() (offsetWidth/Height) > rather than looking at element style (width/height) > which may contain valid size of 'a' or dynlayer size > defined in class 'redbg'. > > - > Kevin > > > while DynLayer._assignElement will now use: > > > > if (dlyr.html!=null && dlyr.html!='' && > (dlyr.w==null > > || dlyr.h==null)) { > > var cw = (dlyr.w==null)? dlyr.getElmWidth() : > null; > > var ch = (dlyr.h==null)? dlyr.getElmHeight() : > null; > > dlyr.setSize(cw,ch); > > } > > > > > > Please run a performance test on this to see if it > is > > ok. > > > > > > Any comments, suggestions? > > > > > > -- > > Raymond Irving > > > > > > --- Kevin <ke...@ke...> wrote: > > > > > > "Raymond Irving" <xw...@ya...> wrote: > > > > > > > > > Hi, > > > > > > > > > > > > > > > When using setClass('whatever',true) you > should > > > always > > > > > create dynlayer with width and height or 0. > This > > > is to > > > > > prevent dynlayer from attempting to autosize > the > > > > > layer. > > > > > > I disagree the w & h should be defaulted to null > in > > > the > > > constructor and not be touched until > _assignElement. > > > > > > > > It was suggested once that we get the width > and > > > the > > > > > height from the style of the layer, but that > > > might not > > > > > be a good thing to do as style sheets can > use > > > > > different values for width and height: > > > > > > > > > > width:100px; height:100px; > > > > > width:100%; height:100%; > > > > > width:100cm; height:100cm; > > > > > > A user/developer knowing that pixels are > supported > > > would use px in style sheets as in the same way > > > lyr=new DynLayer('z',10,10,'100%',100%') > > > wouldn't be expected to work in any case. > > > > > > > > If a layer's style width inside the style > sheet > > > was > > > > > set to 100% then the dynlayer would report > the > > > wrong > > > > > size, correct? > > > > > > > > > > Any thoughts on this? Should we document > that > > > users > > > > > set the width and height to 0,0 when using > style > > > > > sheets? Or should we enable > > > DynLayer.assignElement() > > > > > to first check for a valid css width/height > > > before > > > > > calling getContentWidth/Height? > > > > > > Defaults as explained above. Then in > assignElement: > > > 1) call new methods getElmWidth() & > getElmHeight() > > > to satisfy the style sheet requirement > > > then if the user/developer hasn't specified a > style > > > object > > > or class > > > 2) call getContentWidth() & getContentHeight() > to > > > satisfy > > > the auto size requirement (single character > > > DynLayers etc) > > > > > > - > > > Kevin. > > > > > > > > > > > > > -- > > > > > Raymond Irving > > > > > > > > > > > > > > __________________________________________________ > > > > > Do you Yahoo!? > > > > > The New Yahoo! Search - Faster. Easier. > Bingo > > > > > http://search.yahoo.com > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > This sf.net email is sponsored by:ThinkGeek > > > > > Welcome to geek heaven. > > > > > http://thinkgeek.com/sf > > > > > > _______________________________________________ > > > > > Dynapi-Dev mailing list > > > > > Dyn...@li... > > > > > > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > Dynapi-Dev mailing list > > > Dyn...@li... > > > > > > http://www.mail-archive.com/dyn...@li.../ > === message truncated === __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |