I think that units are missing on the end:
var top = $('image').getWidth() + 'px'
Marko
[email protected] wrote:
> Hello,
>
> this seems so simple but its not working.
> I want to get a width of an Image and set it into a div.
> Maybe im doing it wrong with the var !?
>
> <script type="text/javascript">
>
> document.observe("dom:loaded", function(){
> var top = $('image').getWidth();
> $("big").setStyle({width: top});
>
> });
> </script>
>
> Thanks for help!
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---