mirror of
https://github.com/marcobiedermann/search-engine-optimization.git
synced 2025-03-03 04:09:16 -05:00
open external links in new tab
This commit is contained in:
parent
c1ac3ed9f0
commit
0cdca0e896
18
js/script.js
18
js/script.js
@ -36,12 +36,12 @@
|
||||
// requestAnimationFrame
|
||||
var lastTime = 0;
|
||||
var vendors = ['ms', 'moz', 'webkit', 'o'];
|
||||
var x;
|
||||
var i;
|
||||
var length = vendors.length;
|
||||
|
||||
for (x = 0; x < length && !requestAnimationFrame; ++x) {
|
||||
requestAnimationFrame = [vendors[x] + 'RequestAnimationFrame'];
|
||||
cancelAnimationFrame = [vendors[x] + 'CancelAnimationFrame'] || [vendors[x] + 'CancelRequestAnimationFrame'];
|
||||
for (i = 0; i < length && !requestAnimationFrame; ++i) {
|
||||
requestAnimationFrame = [vendors[i] + 'RequestAnimationFrame'];
|
||||
cancelAnimationFrame = [vendors[i] + 'CancelAnimationFrame'] || [vendors[i] + 'CancelRequestAnimationFrame'];
|
||||
}
|
||||
|
||||
if (!requestAnimationFrame)
|
||||
@ -99,4 +99,14 @@
|
||||
scrollTo(document.getElementById(this.href.split('#')[1]).offsetTop, 800, easing.easeInOutQuad);
|
||||
});
|
||||
|
||||
// Links
|
||||
var links = document.links;
|
||||
length = links.length;
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
if (links[i].hostname != window.location.hostname) {
|
||||
links[i].target = '_blank';
|
||||
}
|
||||
}
|
||||
|
||||
}(window, document));
|
||||
|
Loading…
x
Reference in New Issue
Block a user