Hi
Thanks JAVA Mad.
clientWidth also returns a zero value.
Here is a more detailed version of my code.
this
.layer = document.createElement("div");this.layer.id = "wpDropMenuCtrl";
this.layer.className = this .menuClass;
// Create Content (Items)
var sHtml = "<ul id='wpDropMenuCtrlList'>" ;
for (var i=0; i < menuItems.length; i++) {
var myArray = menuItems[i].split(SEP);
sHtml = sHtml + this.buildListItem(myArray[0], myArray[1]);
}
sHtml = sHtml + "</ul>";
this.layer.innerHTML = sHtml;
this.layer.style.visibility = "visible";
var myArray = menuItems[i].split(SEP);
sHtml = sHtml + this.buildListItem(myArray[0], myArray[1]);
}
sHtml = sHtml + "</ul>";
this.layer.innerHTML = sHtml;
this.layer.style.visibility = "visible";
Before I set the the div to be visible. I need to know what the width of my div will be and set the "offsetTop" and "offsetLeft". The reson for this is if my div is to close to the right of the screen it must then display towords the left of the screen. Unfortunitly i dont know what the contnat of my menu is going to be until it is displayed so i cant set the width before hand as it could be of any width depending on the data that is recived from the server.
Maby i should do this in another way to solve my problem any help?
thank you
On 10/07/06, Java Mad <[EMAIL PROTECTED]> wrote:
try...setting the noWrap property to true.ortry 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.
--
Regards,
Ryan Meder
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
