Last active
February 21, 2022 11:35
-
-
Save oguzhanoptimum7/d1b7faf7d143511ba19ac86d6c6f970c to your computer and use it in GitHub Desktop.
Revisions
-
oguzhanoptimum7 revised this gist
Feb 21, 2022 . 1 changed file with 13 additions and 12 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -39,20 +39,21 @@ jQuery('#sidebar').fadeOut(); jQuery('.toggle').fadeOut(); } }); } }); jQuery(".toggle").click(function() { is_closed = !is_closed; jQuery("#sidebar").hide(); if(getCookie('scrolled') === "yes"){ //FALSE setCookie("scrolled","no",7); }else{ //TRUE setCookie("scrolled","yes",7); } }); }); </script> -
oguzhanoptimum7 revised this gist
Feb 21, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -42,9 +42,11 @@ jQuery(".toggle").click(function() { is_closed = !is_closed; jQuery("#sidebar").hide(); if(getCookie('scrolled') === "yes"){ //FALSE setCookie("scrolled","no",7); }else{ //TRUE setCookie("scrolled","yes",7); } -
oguzhanoptimum7 revised this gist
Feb 21, 2022 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ $(function(){ jQuery(window).resize(function() { let is_closed = false; if(getCookie('scrolled') === "yes"){ is_closed = true; }else{ is_closed = false; @@ -42,7 +42,12 @@ jQuery(".toggle").click(function() { is_closed = !is_closed; jQuery("#sidebar").hide(); if(getCookie('scrolled')){ setCookie("scrolled","no",7); }else{ setCookie("scrolled","yes",7); } }); }); } -
oguzhanoptimum7 revised this gist
Feb 21, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -42,6 +42,7 @@ jQuery(".toggle").click(function() { is_closed = !is_closed; jQuery("#sidebar").hide(); setCookie("scrolled","yes",7); }); }); } -
oguzhanoptimum7 created this gist
Feb 21, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ <script> function setCookie(name,value,days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; path=/"; } function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; } $(function(){ jQuery(window).resize(function() { let is_closed = false; if(getCookie('scrolled')){ is_closed = true; }else{ is_closed = false; } if (jQuery(window).width() < 480) { jQuery(document).scroll(function() { var y = jQuery(this).scrollTop(); if (y > 1200 && !is_closed) { jQuery('#sidebar').fadeIn(); jQuery('.toggle').fadeIn(); } else { jQuery('#sidebar').fadeOut(); jQuery('.toggle').fadeOut(); } jQuery(".toggle").click(function() { is_closed = !is_closed; jQuery("#sidebar").hide(); }); }); } }); }); </script>