Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Scaling elements proportionally using CSS and JQUERY3

$('.box').css('transform','scale(.6)');
console.log($('.box').width())
Comment

Scaling elements proportionally using CSS and JQUERY3

.box{
width:100px;
height:100px;
background:#000;
}
Comment

Scaling elements proportionally using CSS and JQUERY3

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class='box'></div>
Comment

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())
Comment

PREVIOUS NEXT
Code Example
Javascript :: async mutex 
Javascript :: javascript array add method 
Javascript :: arrow function - one line and no parameters 
Javascript :: reverse array without using another array 
Javascript :: splunk : json spath extract 
Javascript :: Store input values in array javascript 
Javascript :: How to limit properties of a JSON object given array of property names using JQ 
Javascript :: Special Chars like DOTS in Express.js route 
Javascript :: C# Convert Json File to DataTable using Newtonsoft.Json DLL 
Javascript :: convert json to string curl 
Javascript :: useEffect in React 18 in strictmode 
Javascript :: Variables In Self Invoking Function 
Javascript :: Modules: Remember All Strings Will Now Have a Property After You Use Require 
Javascript :: three.js animate object regardless screen fps 
Javascript :: Using <template in Javascript to create a form 
Javascript :: Simple Cryptocurrency Blockchain Using JavaScript 
Javascript :: Javascript Encapsulation Inheritance Polymorphism Composition 
Javascript :: javascript download save files in folder 
Javascript :: javascript for website design center text 
Javascript :: 20 most common question in javascript 
Javascript :: Using an object of functions as a parameter into a function 
Javascript :: prisma is and isNot 
Javascript :: livewire multiple root elements detected. this is not supported 
Javascript :: How to Loop Through an Array with a forEach Loop in JavaScript 
Javascript :: how to get on hnage input before clicking off 
Javascript :: how to check if a div tag contains child 
Javascript :: c# to javascript object 
Javascript :: anonymous function js 
Javascript :: javascript array cheatsheet 
Javascript :: splice en javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =