Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Image size scales to = Window size

Image size scales to = Window size
Thread Tools
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
May 27, 2005, 12:10 PM
 
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
Reply With Quote
May 27, 2005, 01:20 PM
 
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
Reply With Quote
May 28, 2005, 04:23 AM
 
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
     
jersey  (op)
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
May 28, 2005, 09:08 AM
 
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
Reply With Quote
May 28, 2005, 03:41 PM
 
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.
     
jersey  (op)
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
May 28, 2005, 07:50 PM
 
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
Reply With Quote
May 29, 2005, 05:10 AM
 
Well, it's out of your hands, then...

But smack 'em round the head on behalf of the MacNN forums, all right?
     
jersey  (op)
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
May 29, 2005, 10:12 AM
 
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.
     
jersey  (op)
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
May 29, 2005, 11:53 AM
 
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
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:33 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2