UNPKG

375to320

Version:

If the screen width of the device is less than 375px (e.g. 320px), this script will fix viewport width to 375px

1 lines 478 B
!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof module&&module.exports?module.exports=t():e["375to320"]=t()}("undefined"!=typeof self?self:this,function(){var e;return(e=function(e){"use strict";var t;null==e&&(e={}),e.minWidth||(e.minWidth=375),screen.width>=e.minWidth&&screen.height>=e.minWidth||(t=screen.width/e.minWidth,document.querySelector('[name="viewport"]').setAttribute("content","width="+e.minWidth+",initial-scale="+t))})(),e});