1
0
mirror of https://github.com/hacks-guide/Guide_3DS.git synced 2025-08-28 10:49:58 +02:00

use js to open external links in new tab

This commit is contained in:
Devon Maloney
2018-06-21 22:58:26 -04:00
committed by Plailect
parent 4502ce7ddc
commit b28ab86d22
26 changed files with 153 additions and 144 deletions

View File

@@ -4,6 +4,15 @@
$(document).ready(function(){
// external links should open in a new tab
var host = location.hostname
var allLinks = document.querySelectorAll('a')
for (var i = 0; i < allLinks.length; ++i) {
if (allLinks[i].hostname !== host && allLinks[i].hostname !== '') {
allLinks[i].target = '_blank'
}
}
// Sticky footer
var bumpIt = function() {
$('body').css('margin-bottom', $('.page__footer').outerHeight(true));

File diff suppressed because one or more lines are too long