js-self-made speed-up gadget: A fast calculator that requires a proportional calculation of the wide and high values when developing pages

Source: Internet
Author: User

<! DOCTYPE html>

<meta charset= "UTF-8" >


<title> Development pages need to scale to calculate the width of the high-worth fast calculator </title>

<body>
<p id= "Jieguo" ></p>
<script type= "Text/javascript" >
window.onload = function () {
var x = window.prompt (' Please enter the expected length is how many px ');
document.getElementById (' Jieguo '). InnerHTML = Math.Round (192 * x/273) + "px";
//Formula: The width-height ratio is: 192/273 So, when you set the height of another set of scale values, you get a wide value. Changing the formula by 192 (representing the width) and 273 (representing the height) is a high value.
}
</script>
</body>

js-self-made speed-up gadget: A fast calculator that requires a proportional calculation of the wide and high values when developing pages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.