(function ($) { function scaleCaptcha() { $('.ginput_container.ginput_recaptcha').each(function () { var self = $(this), width = $(this).parent().width(); if (width < 302) { var scale = width / 302; self.css('transform', 'scale(' + scale + ')'); self.css('-webkit-transform', 'scale(' + scale + ')'); self.css('transform-origin', '0 0'); self.css('-webkit-transform-origin', '0 0'); } }); } // Initialize scaling scaleCaptcha(); // Update scaling on window resize // Uses jQuery throttle plugin to limit strain on the browser $(window).resize($.throttle(100, scaleCaptcha)); })(jQuery);