X Tutup
Skip to content

Commit 40cf52a

Browse files
MarkusMarkus
authored andcommitted
Merge pull request iluwatar#220 from mafagafogigante/patches
PR iluwatar#220: Working back to top button.
2 parents 9d4e4d6 + 4e48369 commit 40cf52a

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Design pattern samples in Java.
22

3-
This is the branch for the pages
3+
This is the branch for the pages.
44

55
Link for Website: http://iluwatar.github.io/java-design-patterns/
66

77
## How to update the website reference
88

9-
Due to the fact that we use submodules, the website doesnt automatically update with the changes in the master branch. And for now this update process is manual, here is how you do it:
9+
Due to the fact that we use submodules, the website doesn't automatically
10+
update with the changes in the master branch. And for now this update process
11+
is manual, here is how you do it:
1012

1113
1. checkout the latest version of the gh-pages branch
1214
2. open a Git Bash at root level of the repo (ls should show you the index.html file)

_layouts/default.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33

44
{% include head.html %}
55

6-
<!-- <body data-spy="scroll" data-target="#myAffix"> -->
76
<body>
87

98
{% include header.html %}
109

11-
1210
<div id="main" class="container main">
1311
{{ content }}
1412
</div>
1513

16-
1714
<div id="top" data-toggle="tooltip" data-placement="left" title="Go to Top">
1815
<a href="javascript:;">
1916
<div class="arrow"></div>

static/js/index.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,32 +103,19 @@ function categoryAndTagDisplay() {
103103
});
104104
}
105105

106-
/**
107-
* 回到顶部
108-
*/
109106
function backToTop() {
110-
//滚页面才显示返回顶部
111107
$(window).scroll(function() {
112108
if ($(window).scrollTop() > 100) {
113109
$("#top").fadeIn(500);
114110
} else {
115111
$("#top").fadeOut(500);
116112
}
117113
});
118-
//点击回到顶部
119114
$("#top").click(function() {
120-
$("body").animate({
121-
scrollTop: "0"
122-
}, 500);
123-
});
124-
125-
//初始化tip
126-
$(function() {
127-
$('[data-toggle="tooltip"]').tooltip();
115+
window.scrollTo(0, 0);
128116
});
129117
}
130118

131-
132119
/**
133120
* 侧边目录
134121
*/

0 commit comments

Comments
 (0)
X Tutup