Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Scaling elements proportionally using CSS and JQUERY3

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
ADD COMMENT
Topic
Name
9+6 =