 |
 |
Image size scales to = Window size
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
I have an issue, but cant figure it out, any help would be appreciated.
This is what I'm trying to do:
I have applied a head action to resize the browser window to 900 x 600.
However, I would like the image(s) to resize according to the users adjustment of the browser window. i.e it opens at 900 x 600 and then the user resizes it 450 x 300. I want the image(s) to scale proportionally.
I think I'm looking for dynamic image resize, but not sure. And if that is correct how do I apply it in CS2 GoLive?
Thanks,
-j
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status:
Offline
|
|
Hmmm. Interesting. While I don't have sample code for you, you can probably use PHP"s getimgsize() function first, then pass the resulting variables to JavaScript to define the size of the window.
HTH.
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status:
Offline
|
|
Just use percentages for the height and width. e.g.
<img src="image.jpg" height="100%" width="100%" />
Although, if you're looking for more control, (as in it's not just one image needing to be the full size of the window, but an actual page full of text and images etc) then you could handle it in JavaScript, listening to the onresize event and adjusting accordingly. If that's more the case, then I'll post a code example later for you 
|
|
Just who are Britain? What do they? Who is them? And why?
Formerly Black Book
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
Originally Posted by Black Book
Just use percentages for the height and width. e.g.
<img src="image.jpg" height="100%" width="100%" />
Although, if you're looking for more control, (as in it's not just one image needing to be the full size of the window, but an actual page full of text and images etc) then you could handle it in JavaScript, listening to the onresize event and adjusting accordingly. If that's more the case, then I'll post a code example later for you
thanks......i found the code about midnight.
the java example will be really helpful, since i'm sure that'll be next.
thanks,
-j
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: Mar 2004
Location: Copenhagen
Status:
Offline
|
|
A piece of advice:
Try to avoid resizing the window. It ranks right up there with Flash pop-ups in terms of annoyingness.
For myself (and many others, I can only presume), unless it's something vitally necessary, if a page resizes my window, I leave the site immediately, and don't return.
If you want to control the size of the page, put it inside a very well defined box of 900x600 px (for instance, dark grey page background + box with white background, containing all content). If the user for some reason has his browser set to smaller than 900x600 px, chances are he/she will resize the window to show the entire box without having to browse.
Also realise that if you have the page size at 900x600 px, you are excluding a fair amount of people (those who are still on 800x600 - and yes, they do exist, and there are more of them than you'd think, though they might not be relevant for you, depending on what kind of page it is, and who the target group is) from viewing the page properly. Especially on Windows (and especially with Explorer), a browser window resized to a size larger than the available screen space is a royal pain in the rear end, 'cause Windows will almost always (for some reason known only to the little elves that work at Microsoft and whose sole job it is to add annoying little bits and pieces to Windows) enlarge the window in such a manner that both the title bar, all the menus, and the bottom right corner disappear outside the screen, making it impossible get to any of the places where you can resize it manually.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
Originally Posted by Oisín
A piece of advice:
*snip* .
Thanks for the advice and suggestions.i know i find that kind of thing annoying, and normally wouldnt do it, but it was requested by the person i'm helping out. They have been warned several times about how it really pisses people off, and how there are still, for some unknown reason, a lot of people on 800 x 600. But some people just wont listen.
-j
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: Mar 2004
Location: Copenhagen
Status:
Offline
|
|
Well, it's out of your hands, then...
But smack 'em round the head on behalf of the MacNN forums, all right? 
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
Originally Posted by Oisín
Well, it's out of your hands, then...
But smack 'em round the head on behalf of the MacNN forums, all right?
they have been thoroughly smacked several times already. but i'll throw one on 'em for the 'nn next time we speak.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
Originally Posted by Black Book
Just use percentages for the height and width. e.g.
<img src="image.jpg" height="100%" width="100%" />
Although, if you're looking for more control, (as in it's not just one image needing to be the full size of the window, but an actual page full of text and images etc) then you could handle it in JavaScript, listening to the onresize event and adjusting accordingly. If that's more the case, then I'll post a code example later for you
The image map breaks with the above code, so it seems as if I will have to use java to control the page.
-j
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|