Last active
December 28, 2015 17:42
-
-
Save AdsonCicilioti/1adf4f50b688ce2b8b19 to your computer and use it in GitHub Desktop.
Revisions
-
AdsonCicilioti revised this gist
Dec 28, 2015 . 1 changed file with 0 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 @@ -17,5 +17,4 @@ jQuery(document).ready(function($) { scrollTop: that_offset.top - 150 // Set a negative value to compensate for a fixed height of the top bar }, speed); } }); -
AdsonCicilioti revised this gist
Dec 28, 2015 . 1 changed file with 2 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 @@ -1,11 +1,11 @@ jQuery(document).ready(function($) { ////// ANCHOR SMOOTH $('a[href^="#"]').click(function(e) { e.preventDefault(); anchorScroll( $(this), $($(this).attr('href')), 800 ); }); function anchorScroll(this_obj, that_obj, base_speed) { var this_offset = this_obj.offset(); var that_offset = that_obj.offset(); -
AdsonCicilioti revised this gist
Dec 28, 2015 . No changes.There are no files selected for viewing
-
AdsonCicilioti revised this gist
Dec 28, 2015 . 1 changed file with 14 additions and 14 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 @@ -1,21 +1,21 @@ jQuery(document).ready(function($) { ////// ANCHOR SMOOTH $('a[href^="#"]').click(function(e) { e.preventDefault(); anchorScroll( $(this), $($(this).attr('href')), 800 ); }); function anchorScroll(this_obj, that_obj, base_speed) { var this_offset = this_obj.offset(); var that_offset = that_obj.offset(); var offset_diff = Math.abs(that_offset.top - this_offset.top); var speed = (offset_diff * base_speed) / 1000; $('html,body').animate({ scrollTop: that_offset.top - 150 // Set a negative value to compensate for a fixed height of the top bar }, speed); } }); -
AdsonCicilioti created this gist
Dec 28, 2015 .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,21 @@ jQuery(document).ready(function($) { ////// ANCHOR SMOOTH $('a[href^="#"]').click(function(e) { e.preventDefault(); anchorScroll( $(this), $($(this).attr('href')), 800 ); }); function anchorScroll(this_obj, that_obj, base_speed) { var this_offset = this_obj.offset(); var that_offset = that_obj.offset(); var offset_diff = Math.abs(that_offset.top - this_offset.top); var speed = (offset_diff * base_speed) / 1000; $('html,body').animate({ scrollTop: that_offset.top - 150 // Set a negative value to compensate for a fixed height of the top bar }, speed); } });