DVD Talk Forum

DVD Talk Forum (https://forum.dvdtalk.com/)
-   Tech Talk (https://forum.dvdtalk.com/tech-talk-10/)
-   -   Automatically resize images on a webpage depending on monitor size? (https://forum.dvdtalk.com/tech-talk/609895-automatically-resize-images-webpage-depending-monitor-size.html)

danwiz 04-08-13 01:50 AM

Automatically resize images on a webpage depending on monitor size?
 
The title says what I want to do - I want to use a style sheet or something to automatically resize images on a webpage depending on the viewer's monitor size/resolution. I Googled it and found several solutions, but I could not make any of the methods which I found work for me.

I can't point you to the page I am trying to make this work on due to restrictions on use of my domain name on this forum. If you go to a new browser tab or window and type in my username followed by dot com you can see the page I am trying to get this to work on though. You'll note that the image size is only 800 x 600 (or thereabouts) to accommodate people with small monitors, but if I could figure out a way to make it automatically resize then I would make the image larger.

You can view the page source code, which is implemented through the use of minimal code plus 3 php includes - one for the header, one for the body and one for the counter.

Please - I'm not the sharpest person with using CSS or jscript, so if you have an answer then please post or PM me with instructions for dummies. Please don't just assume that I'll know what you're talking about.

Thanks in advance.

twikoff 04-08-13 10:48 AM

Re: Automatically resize images on a webpage depending on monitor size?
 
i always used a percentage instead of a fixed size, so that it would adjust based on user resolution..
but i havent worked web pages in 10-12 years at least... so Im sure things have changed alot ;)

Music 04-08-13 11:05 AM

Re: Automatically resize images on a webpage depending on monitor size?
 
You would think that would be something they build into the web browser. :shrug:

palebluedot 04-08-13 06:29 PM

Re: Automatically resize images on a webpage depending on monitor size?
 
Try this http://stackoverflow.com/questions/6...browser-window

danwiz 04-08-13 07:47 PM

Re: Automatically resize images on a webpage depending on monitor size?
 
Thanks palebluedot. That is one of the sources I looked at when I Googled it and one which I played with quite extensively, but I can't make it work, probably because I can't understand exactly what code I need to include!

palebluedot 04-08-13 07:56 PM

Re: Automatically resize images on a webpage depending on monitor size?
 

Originally Posted by danwiz (Post 11645217)
Thanks palebluedot. That is one of the sources I looked at when I Googled it and one which I played with quite extensively, but I can't make it work, probably because I can't understand exactly what code I need to include!

Everything you need is right there in the example.

Just make sure your image is as large as the highest resolution possible. If it is 800x600 then that is the largest it can be. You can go smaller, just not bigger.

danwiz 04-08-13 09:37 PM

Re: Automatically resize images on a webpage depending on monitor size?
 
Okay, seems like it's working in everything except Firefox (20.0)! In Safari (5.1.7), Chrome (26.0.1410.43 m) and IE (10) the image resizes precisely as it should, so that both height and width fit in the browser window, however, in Firefox with my window maximized (my monitor is 1600 x 900) the image resizes to the correct width, but the height is way off the bottom of the monitor. I have been playing around and if I resize the Firefox Window so that the width is LESS than the height (landscape mode photo) and reload the page then it's okay. Any suggestions or is it just not going to work with Firefox?

danwiz 04-08-13 11:20 PM

Re: Automatically resize images on a webpage depending on monitor size?
 
Here is some very simple coding which I found which works nicely:

http://www.dynamicdrive.com/forums/s...spect-ratio%29



The only problem I have with this is that it will only work with a single image on a page. And - why does this code have an end body tag and that's followed by an end head tag? Is that an error or does it serve some purpose? Any ideas how to make it work with more than one image on a page?

danwiz 04-10-13 06:52 AM

Re: Automatically resize images on a webpage depending on monitor size?
 
palebludot Please talk to me. If you have no time now, or are working on that code to determine what can be done to make it work in Firefox or whatever, please let me know that you read my post anyway. Thank you.


All times are GMT -5. The time now is 02:09 PM.


Copyright 2018 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.