|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Helpless newbie here. I am trying to open a new window, sized appropriately to hold either a portrait or landscape oriented image. For this I need to know the width of the new image before I open the window.
I'm pretty clueless, but this seemed to me to be the simplest way to do this: var img = new Image("http://helma.org/images/hop.gif"); var w = img.getWidth(); newwindow=window.open('','jav','width=w,height=100 "); Opening the window is no problem, but getting the width of the image is. Any help? I'm trying to keep this simple. Do I have to load the image first? If so how? Do I need to create a class? If so, I am clueless. I have searched out a million references to the getWidth() function but there are no simple examples of this use. |
|
#2
|
||||
|
||||
|
Quote:
Does that help at all? |
|
#3
|
||||
|
||||
|
Um, ignore the spaces in myImage.width.toString()
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Help with getWidth() |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|