Make max-width window height

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Make max-width window height

Wombat
I have both portrait and landscape images in my gallery. I don't like, since almost all screens are also landscape, that my landscape images are considerably larger than my portrait images.

Is there a way to set a max-width (or something) on my images, so that the width of my landscape images is never larger than the height of my portrait images.

Confused? Here's a graphic I whipped up to try and explain:

http://verburgt.dk/stuff/maxwidth.jpg

Thanks in advance for any advice given.
Reply | Threaded
Open this post in threaded view
|

Re: Make max-width window height

Wombat
I'm not a Javascript guy, so after a lot of trial and error, guessing and Googling, I've gotten this far...

I changed this piece of code in "shadowbox.js":

function aB(){
        aa.style.height=Q.getWindowSize("Height")+"px";
        aa.style.width=Q.getWindowSize("Width")+"px"
}

To this:

function aB(){
        aa.style.height=Q.getWindowSize("Height")+"px";
        aa.style.width=Q.getWindowSize("Height")+"px";
        aa.style.marginLeft = "-"+aa.offsetWidth/2 +"px"
}

I made it so the width of "sb-container" is the same as it's height. I also changed the CSS of "sb-container" so "left" is now 50%. This means none of the scale-to-fit coding of the image itself has changed.

Hope this helps someone and saves them a lot of fiddling, saving, changing, testing, Googling, changing, saving, testing and so on...

I have another problem now as far as "sb-overlay" no longer covering the entire window, but I'll work on it for a bit and come back if I need any further help from you guys here. Thanks