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, '/');
- // console.log("0oo");
- } else if (h >= 1 && h <= 600) {
- window.history.pushState(null, null, "abc");
- // console.log("test");
- } else if (h >= 600 && h <= 1200) {
- history.pushState(null, null, 'def');
- // console.log("test1");
- } else if (h >= 1200 && h <= 1800) {
- history.pushState(null, null, 'ghi');
- // console.log("test2");
- } else if (h >= 1800 && h <= 2400) {
- history.pushState(null, null, 'jkl');
- // console.log("test3");
- } else if (h >= 2400 && h <= 3000) {
- history.pushState(null, null, 'mno');
- // console.log("test4");
- } else if (h >= 3000 && h <= 3600) {
- history.pushState(null, null, 'pqr');
- // console.log("test5");
- } else if (h >= 3600 && h <= 4200) {
- history.pushState(null, null, 'stu');
- // console.log("test6");
- } else {
- }
- }
PardeepPosted Dec 10, 2019, 5:41 AM
Rajanikant HawaldarPosted Dec 9, 2019, 10:04 PM