Hi Ryan
 
Does this work for you?:
 
//Parm o is naturally your layer variable.
 
function getElementWidth(o) {
 var x;
 
 if (!o) {
  return 0;
 }
 
 if (o.innerWidth) { // all except IE
   x = o.innerWidth;
 } else {
  if (o.clientWidth) {  // IE
    x = o.clientWidth;
  } else {
    x = 0;
  }
 }
 
 return x;
}

>>> [EMAIL PROTECTED] 07/10/06 8:50 AM >>>
try...
setting the noWrap property to true.
or
try and use the clientWidth

Ryan Meder <[EMAIL PROTECTED]> wrote:

Hi,
 
I would like to ask a _javascript_ question for my pop up menu. My menu that pops up is created dynamically using _javascript_ and the contents and links on the menu are created according to data from the db. The way it works is as the user clicks on an icon the data is requested from the server to populate the drop down menu using an Ajax request.
 
The code is a "div" element like (this.layer = document.createElement("div");)
I then add the contents of the menu the to object called "layer" and display the menu to the screen.
 
What I require is to get the width or the offsetWidth off the Div object that I have dynamically created. At the moment when the method "offsetWidth" is called I get the value "0". Is there any way I can get this value before I display the element to the screen so that I can display it correctly.
 
Any help would be helpful.
 
Regards,
 
Ryan


How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.
SANTAM Bpk / Ltd
Reg. No. 1918/001680/06


Directors: DK Smith (Chairman), SC Gilbert (Chief Executive), S Bray (Company Secretary), JJ Geldenhuys, JG le Roux, Dr NM Magau, AR Martin, Mr EA Moolla, JE Newbury, P de V Rademeyer, GE Rudman, Dr J van Zyl, BP Vundla, (Executive) MJ Reyneke


Please note: This email and its content are subject to the disclaimer as displayed at the following link http://www.santam.co.za/disclaimer.htm. Should you not have Web access, send a mail to [EMAIL PROTECTED] and a copy will be emailed to you.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CTJUG Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/CTJUG-Forum
For the ctjug home page see http://www.ctjug.org.za
-~----------~----~----~----~------~----~------~--~---

Reply via email to