MAXIMUM SIZE IMAGES

lorenapomodoro / 2011-07-25 11:36:02   

Hello all.
I am using a resizing plugin for my webpage.
I'd like some help on the following issue.
I don't want the images to be resized if the size of the window is bigger than the size of the original image file.

Any help?

Thank you all.
Sandra

G470 / 2011-07-25 12:44:12   

Hi, you can do this with css.

Your Images are 603 px in nature so all you have to do is change the max-height ;)

  1. .picture img {
  2. margin-right: 20px;
  3. max-height: 603px;
  4. }
lorenapomodoro / 2011-07-25 14:06:22   

Thank you G740!
That works! And is a perfect solution for now...
But what happens if I have different maximum sizes for different projects?
That's why i thought that it needed to be done through an 'if' statement in the re-size plugin that you actually wrote for me...
Is it a complicate thing?

Thanks a lot!
Sandra

G470 / 2011-07-25 14:22:28   

Not really complicated :) but I thought this solution is more simple.
You can put in a second each loop to check the image height and in this loop you need a if statement.

something like:

$('.picture img').each(function(){
var windowheight = $(window).height();
var itstheheight = $(this).height();
if(itstheheight

lorenapomodoro / 2011-07-26 04:10:51   

Thank you G740.
But I am afraid I am not sure where to insert that, and that something is missing for the complete functioning. I tried several times, but no luck.
I guess I should go for a quick programming course. :)
if you anytime and you can tell me the end of those lines it would grand!
thanks again!

G470 / 2011-07-26 11:33:58   

puuuuuuh!!! just saw that the code is cut off in my post... This way it won´t word ;)

i´ll try again:

New Script: raumzwei.gatonet.de/downloads/horizontal_sized_till_image_max_size.zip
Demo: http://raumzwei.gatonet.de/horizontal-max-image-height/

lorenapomodoro / 2011-07-28 08:45:16   

Thank you!
shall i just add the js file in the js folder? and the pluging of course...
i had a go, not working. i'll try again if that is the way!

thanks

website very useful!

G470 / 2011-07-28 09:28:10   

Yes, just put the files in the folders and choose the new exhibit format in your admin backend. :) It should work. Maybe update your main jquery.js to a new version. Poste back if you got errors.

lorenapomodoro / 2011-08-10 11:05:23   

hello g470.
sorry for not getting back before. i haven't had time to struggle/play with this stuff. :)
thanks for ur help.
thanks for the links! very useful!
Will try again to fix my page in the way i want.
will post something again if i can't make it! Thanksssss!

This thread has been closed, thank you.