From 56e0cf940fbc6d1b987b342c0ab92a4d99e3c726 Mon Sep 17 00:00:00 2001 From: Steven Haskell Date: Fri, 19 Oct 2018 00:08:02 -0400 Subject: [PATCH] Revert "Fixed Scroll adjusting" This reverts commit 2306e8aa850e2ead37c7929880c10ad045f26dfa. --- .DS_Store | Bin 6148 -> 6148 bytes index.html | 4 +- ...ght Calculation Script-Edited-Jquery-V4.js | 49 ++++++++++++------ 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/.DS_Store b/.DS_Store index ddf4d2662ba139a71954431302df313e57011265..ef07dc3810fd09c4b6571c08b51f7e8e5156548e 100644 GIT binary patch delta 71 zcmZoMXfc=|#>B)qF;Q%yo+6{b#(>?7i~^f^SP~c~m$F4~mf_%LnOI=DnVo~51E_4X ZAjfy+$^0UY91K9f$iTp|IYML&GXQ#c5DEYQ delta 348 zcmZoMXfc=|#>B!kF;Q%yo+6{r#(>?7i!U%UF$!(wVM<`EPbx1iNXp4iVqjqSnpBXJ zSzKaZaD$PFnT3^&or9B$lZTU!lQT9rBfmVjB(bEl*eS6nUO*-|GbJ@Cu_!zrNbj{Lo>rE(S(M2+be}r6CkE1H+NYDa^@} z>zP@3%7TmXa`N-ifl`bc6V(_uvvcrs0K;zcLFVtwlles)Ie>;Rfi!N85Lv?v0AnO! A_W%F@ diff --git a/index.html b/index.html index 908f744..40ba1dc 100644 --- a/index.html +++ b/index.html @@ -7,12 +7,14 @@ + + @@ -91,7 +93,7 @@
- +
diff --git a/js/Weight Calculation Script-Edited-Jquery-V4.js b/js/Weight Calculation Script-Edited-Jquery-V4.js index 267bfb0..49f43bb 100644 --- a/js/Weight Calculation Script-Edited-Jquery-V4.js +++ b/js/Weight Calculation Script-Edited-Jquery-V4.js @@ -106,33 +106,50 @@ // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area $('html, body').animate({ scrollTop: $(hash).offset().top - }, 500, function(){ + }, 800, function(){ // Add hash (#) to URL when done scrolling (default click behavior) window.location.hash = hash; }); } // End if }); + }); - //Saves scroll position on focus and restores - var savedScrollTop; + //Saves scroll position on focus and restores + var savedScrollTop function saveScroll() { - savedScrollTop = jQuery(document).scrollTop(); + var savedScrollTop = jQuery(document).scrollTop(); // save scroll position console.log(savedScrollTop); } - - - function restoreScroll(){ + function restoreScroll(savedScrollTop){ jQuery("html, body").animate({ scrollTop: savedScrollTop - }, 250).offset().top; + }, 800).offset().top; } - //jQuery event watching - jQuery(".input-weight").on("focus", function(){ - saveScroll(); - }); - jQuery(".input-weight").on('blur', function(){ - restoreScroll() - }); - }); +//Failed scroll restore functions + + // jQuery("#Weight").blur(function(event) { + // $("html, body").animate({ + // scrollTop: savedScrollTop + // }, 800).offset().top; + // }); + + + /*function restoreScroll() { + $("a").on('click', function(event) { + + jQuery(window).scrollTop(savedScrollTop);*/ +/* window.scrollTo({ + top: "savedScrollTop", + behavior: "smooth" + }); // restore it*/ + + + + + + /*var savedScrollTop = $(document).scrollTop(); // save scroll position + + $(document).scrollTop(savedScrollTop ); // restore it*/ +// }); \ No newline at end of file