I am just changing the url when page go to particular height. but it shows me error in the chrome :Throttling history state changes to prevent the browser from hanging. after 1200 height. but it is working fine in the firefox.
- function myFunction() {
- var h = ($("html").scrollTop());
- if (h == 0) {
- window.history.pushState(null, null, '/');
-
- } else if (h >= 1 && h <= 600) {
- window.history.pushState(null, null, "abc");
-
- } else if (h >= 600 && h <= 1200) {
- history.pushState(null, null, 'def');
-
- } else if (h >= 1200 && h <= 1800) {
- history.pushState(null, null, 'ghi');
-
- } else if (h >= 1800 && h <= 2400) {
- history.pushState(null, null, 'jkl');
-
- } else if (h >= 2400 && h <= 3000) {
- history.pushState(null, null, 'mno');
-
- } else if (h >= 3000 && h <= 3600) {
- history.pushState(null, null, 'pqr');
-
- } else if (h >= 3600 && h <= 4200) {
- history.pushState(null, null, 'stu');
-
- } else {
-
- }
- }