All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.prod.util.isElementInView.js.map Maven / Gradle / Ivy

{
  "version": 3,
  "sources": ["../../../src/util/isElementInView.ts"],
  "sourcesContent": ["/**\n * Determines if the element is within the viewport.\n * @param el {HTMLElement}\n */\nconst isElementInView = (el: HTMLElement) => {\n\tconst rect = el.getBoundingClientRect();\n\n\treturn (\n\t\trect.top >= 0 && rect.left >= 0\n\t\t\t&& rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n\t\t\t&& rect.right <= (window.innerWidth || document.documentElement.clientWidth)\n\t);\n};\n\nexport default isElementInView;\n"],
  "mappings": "aAIA,MAAMA,EAAmBC,GAAoB,CAC5C,MAAMC,EAAOD,EAAG,sBAAsB,EAEtC,OACCC,EAAK,KAAO,GAAKA,EAAK,MAAQ,GAC1BA,EAAK,SAAW,OAAO,aAAe,SAAS,gBAAgB,eAC/DA,EAAK,QAAU,OAAO,YAAc,SAAS,gBAAgB,YAEnE,EAEA,eAAeF",
  "names": ["isElementInView", "el", "rect"]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy