I think that units are missing on the end:

var top = $('image').getWidth() + 'px'

Marko

clicforw...@googlemail.com 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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to