Detect when your site is visible to users

tipjs,web_developer

document.onvisibilitychange = function () {
          document.visibilityState === "visible"
             ? (document.title = "👋 Hello")
             : (document.title = "😟 Bye!");
       };

Có thể bạn đã miss một số snippets code

Rolling loading

Nguyên tắc là theo dõi các sự kiện cuộn trang và phân tích mối quan hệ thuộc tính giữa clientHeight , scrollTop và scrollHeight .

Random Number javascript

Random Number javascript

Extend Object javascript

Extend Object javascript

Converting Object to an Array

Converting Object to an Array

encode/decode base64 with JS

Encoding to base64 is done with the btoa command