Last active
February 23, 2021 07:33
-
-
Save ManotLuijiu/c1909260ba24da0715e9376608b05273 to your computer and use it in GitHub Desktop.
How to hide element in JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.onscroll = function() { | |
if (window.innerHeight + window.scrollY > document.body.clientHeight) { | |
document.getElementById('means__social__th').style.display='none'; | |
} | |
if (document.getElementById('means__social__th') && \ | |
window.innerHeight + window.scrollY < document.body.clientHeight) \ | |
{ | |
document.getElementById('means__social__th').style.display='block'; | |
} | |
} | |
// บรรทัดที่ 5 มีเครื่องหมาย "และ" หรือ "&&" แสดงว่า เงื่อนไขต้องเป็นจริงทั้งคู่ มันถึงจะทำงาน |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment