I am having a couple issues on this portfolio site that I am in the middle of making.
http://jdwdb.com/seb/
This is the site that I am working on. If you click on the menu on the left, images should pop up horizontally. As you can see, I have tried a couple different methods. I need the photographs to grow/shrink according to the size of the browser window.
www.tomhoops.com
I am using this site as a reference. I love how fluid the images shift and I am trying to recreate that effect. I am even fine with media queries, even though the fluid responsiveness is a lot more attractive.
I've used zeros, which should fill the parent div. Trouble is, it does not keep the aspect ratio correct, which looks odd. To expand/contract AND keep the aspect ratio you need to use JavaScript, which I cannot help with. I just use a fixed size graphic with a low z-index (e.g. -1) and attach it to one corner. E.g.
position:fixed;
left=170px; /* allow for menu bar */
top=80px; /* allow for header */
z-index=-1; /* hide overflow to right and or below */
Use a percentage ('%') for the CSS height setting for #photostrip instead of the fixed setting of '830px'. That way it will be a percentage of it's container (probably the window/viewport - I didn't look that closely), and the images in your <ul> should resize correspondingly since they're set to '100%'.
Note that you should correct the syntax on the page. The values for several attributes on your HTML elements are terminated with a semi-colon (';'). HTML attributes should either have no terminator, or (best practice) enclosed in single or double quotation marks. Good luck!
Use a percentage ('%') for the CSS height setting for #photostrip instead of the fixed setting of '830px'. That way it will be a percentage of it's container (probably the window/viewport - I didn't look that closely), and the images in your <ul> should resize correspondingly since they're set to '100%'.
Making the height a percentage will not preserve the aspect ratio of the pictures. The easiest way to do that is to use a div as a re-sizeable view port onto a static picture that matches the largest size that is required. E.g. to fill an HD screen that has a 170 pixel side menu, a 150 pixel top bar and a 90 pixel footer you need a 1750x840 picture. Set overflow=hidden or set the z-index to hide the overflow, and the viewable area can expand and contract without affecting the aspect ratio of the picture.
Note: When using large pictures, it is particularly important to optimize them. Unoptimized, a picture that size can be 400KBytes+. That can often be optiimized down to 100 to 150 KBytes (or less).
Bookmarks