Skip to content

Commit 95558c6

Browse files
committed
fix
1 parent f82dc7d commit 95558c6

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

_layouts/default.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@
55

66
<!-- hack iOS CSS :active style -->
77
<body ontouchstart="">
8-
8+
<script type="text/javascript">
9+
function addBlankTargetForLinks () {
10+
$('a[href^="http"]').each(function(){
11+
$(this).attr('target', '_blank');
12+
});
13+
}
14+
15+
$(document).bind('DOMNodeInserted', function(event) {
16+
addBlankTargetForLinks();
17+
});
18+
19+
</script>
920
{% include nav.html %}
1021

1122
{{ content }}
1223

1324
{% include footer.html %}
1425

15-
function addBlankTargetForLinks () {
16-
$('a[href^="http"]').each(function(){
17-
$(this).attr('target', '_blank');
18-
});
19-
}
2026

21-
$(document).bind('DOMNodeInserted', function(event) {
22-
addBlankTargetForLinks();
23-
});
2427

2528

2629
<!-- Image to hack wechat -->

0 commit comments

Comments
 (0)