Skip to content

Instantly share code, notes, and snippets.

View pudly's full-sized avatar
💭
Busy setting my status on Github.

Andrej Simeonov pudly

💭
Busy setting my status on Github.
View GitHub Profile
[].forEach.call(document.querySelectorAll('a[href^=http]'), function(el) {
var url = el.href;
var base = window.location.hostname;
if (!url.indexOf(base)) {
el.setAttribute('target','_blank');
}
})
var $featured_nav = document.querySelector('.post--featured > nav');
if ($featured_nav) {
$featured_nav.addEventListener('scroll', function() {
var fw = $featured_nav.scrollWidth;
var fc = $featured_nav.scrollLeft;
var fm = $featured_nav.clientWidth;
$featured_nav.classList.remove('__notscrolled');