Skip to content

Instantly share code, notes, and snippets.

View richwertz's full-sized avatar
😎
push it. push it good.

Rich Wertz richwertz

😎
push it. push it good.
  • Noord Brabant, Netherlands
  • 16:29 (UTC +02:00)
View GitHub Profile
@HoundstoothSTL
HoundstoothSTL / anchor-scroll-with-offset.js
Created May 3, 2013 15:43
Anchor scroll with fixed header offset
(function($) {
$('a[href*=#]:not([href=#])').click(function()
{
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname)
{
var target = $(this.hash),
headerHeight = $(".primary-header").height() + 5; // Get fixed header height