Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js get vh value

function vh(v) {
  var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  return (v * h) / 100;
}

function vw(v) {
  var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  return (v * w) / 100;
}

function vmin(v) {
  return Math.min(vh(v), vw(v));
}

function vmax(v) {
  return Math.max(vh(v), vw(v));
}
console.info(vh(20), Math.max(document.documentElement.clientHeight, window.innerHeight || 0));
console.info(vw(30), Math.max(document.documentElement.clientWidth, window.innerWidth || 0));
console.info(vmin(20));
console.info(vmax(20));
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript validate date 
Javascript :: Get the Status Code of a Fetch HTTP Response 
Javascript :: postcss.config.js 
Javascript :: what is data node in big data 
Javascript :: open a particular slide on click button in owl carousel 
Javascript :: if jsp 
Javascript :: get days in current month using moment.js 
Javascript :: chartjs disable animation 
Javascript :: sum of digits in a whole number javascript 
Javascript :: how to send header in axios 
Javascript :: express get host url 
Javascript :: How to get tailwindcss intellisense to work with react files 
Javascript :: how to make option selected edit in jquery 
Javascript :: js find space in string 
Javascript :: react router refresh page 
Javascript :: es6 remove first element of array 
Javascript :: React does not recognize the `activeClassName` prop on a DOM element 
Javascript :: video in react native stack overflow 
Javascript :: console table js 
Javascript :: nuxt-link name params 
Javascript :: compose es6 
Javascript :: node cron every 10 minutes 
Javascript :: javascript onclick open url same window 
Javascript :: check if an object contains a value in javascript 
Javascript :: convert array to object javascript 
Javascript :: readonly vs disabled 
Javascript :: how to see if the window has focus in js 
Javascript :: javascript get elements that exist in two arrays 
Javascript :: js toggle value 
Javascript :: empty input of clone jquery 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =