Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Scaling elements proportionally using CSS and JQUERY

let scale = .6;
let w = $('.box').width() * scale;
let h = $('.box').height() * scale;
$('.box').css({'height' : h, 'width' : w})
console.log($('.box').width())
 
PREVIOUS NEXT
Tagged: #Scaling #elements #proportionally #CSS #JQUERY
ADD COMMENT
Topic
Name
9+2 =