Last active
August 29, 2015 14:07
-
-
Save Phonbopit/db1db3590ba668bb69be to your computer and use it in GitHub Desktop.
Ghost Theme Development Part 5 : http://devahoy.com/2014/10/getting-started-with-ghost-theme-development-part5
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 characters
(function ($) { | |
"use strict"; | |
var MQL = 1170; | |
//primary navigation slide-in effect | |
if ($(window).width() > MQL) { | |
var headerHeight = $('.navbar-custom').height(); | |
$(window).on('scroll', { | |
previousTop: 0 | |
}, | |
function() { | |
var currentTop = $(window).scrollTop(); | |
//check if user is scrolling up | |
if (currentTop < this.previousTop) { | |
//if scrolling up... | |
if (currentTop > 0 && $('.navbar-custom').hasClass('is-fixed')) { | |
$('.navbar-custom').addClass('is-visible'); | |
} else { | |
$('.navbar-custom').removeClass('is-visible is-fixed'); | |
} | |
} else { | |
//if scrolling down... | |
$('.navbar-custom').removeClass('is-visible'); | |
if (currentTop > headerHeight && !$('.navbar-custom').hasClass('is-fixed')) $('.navbar-custom').addClass('is-fixed'); | |
} | |
this.previousTop = currentTop; | |
}); | |
} | |
//hightlight.js | |
$("pre code").each(function(i, e) {hljs.highlightBlock(e); }); | |
}(jQuery)); |
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 characters
<div id="fb-root"></div> | |
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&appId=1475043666088428&version=v2.0"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</script> | |
<div class="fb-comments" data-href="http://example.com/comments" data-numposts="5" data-colorscheme="light"></div> |
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 characters
<head> | |
<!-- Github CSS --> | |
<link href="{{asset "css/github.css"}}" ref="stylesheet"> | |
</head> | |
<body> | |
<!-- highlight.js --> | |
<script src="{{asset "js/highlight.pack.js"}}"></script> | |
<!-- Custom Theme JavaScript --> | |
<script src="{{asset "js/clean-blog.js"}}"></script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment