resurrectorx
resurrectorx

Reputation: 25

Resizing all the elements inside a div using jQuery

I've used this -->

$( document ).ready(function() {
$('#recorder').css('-webkit-transform', 'scale(0.75)');
});

to resize all the elements(images, etc) to 75% of its orginal value. It worked fine in Chrome(Version 31.0.1650.63 m), but in firefox the div didn't seem to resize.

Is there any way i could make this work in more browsers? Thanks.

Upvotes: 2

Views: 3857

Answers (1)

adeneo
adeneo

Reputation: 318202

Firefox isn't a webkit browsers, so no suprise there

$( document ).ready(function() {
     $('#recorder').css({
         '-webkit-transform' : 'scale(0.75)',
            '-moz-transform' : 'scale(0.75)',
             '-ms-transform' : 'scale(0.75)',
              '-o-transform' : 'scale(0.75)',
                 'transform' : 'scale(0.75)'
     });
});

It's worth noting that jQuery in many cases will do the prefixing for you, and transform should be one of the properties where that works as expected, so just using transform should be enough.

$( document ).ready(function() {
     $('#recorder').css('transform', 'scale(0.75)');
});

Upvotes: 6

Related Questions