Hello,
I'm trying to get the width of a created element by the following way:
// create div element
var itemDiv = new Element('div', {
'id' : 'item-1',
'class' : 'item'
});
// create image element
var itemImage = new Element('img', {
'src' : itemPath + image['src'][0],
'alt' : ''
});
// append image to div
itemDiv.appendChild(itemImage);
var width = itemDiv.getWidth(); // always returns 0
This code is executed in an each() function and every image got
different dimensions. So the width of every div is different. I need
the complete width of all created div elements. But the getWidth()
function always returns 0. Even getDimensions() does not work. So is
there any way to get the width of a created element?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---