views:

11

answers:

1

Kind of an awkward title guys, sorry.

Anyway, I'm trying to resize my images with the following snippet of jQuery:

$(window).load(function(){
$('img.FancyBox').each(function(){
$(this).width($(this).width() * 0.25);
});
});

Now, this works, but it would be really nice if I could find a way to specify the images to load 25% of their original size, rather than loading their original size, and scaling down.

It works, but it looks kind of odd.

Any sort of workaround would be great!

Thanks!

+2  A: 

you could set .FancyBox to display: none; in your CSS and then do:

$(window).load(function(){
    $('img.FancyBox').each(function(){
        $(this).width($(this).width() * 0.25);
        $(this).show();
    });
});
Thomas Clayson
Oh! Nice idea! Good solution, as it appears as though it just took a little while to load. I think I'll implement this, and just hard code the scaled down sized after a while xD. Thanks.
BOSS