Skip to content

Commit

Permalink
Merge pull request #378 from support-project/feature/issue375_return_…
Browse files Browse the repository at this point in the history
…to_top

Feature/issue375 return to top
  • Loading branch information
koda-masaru committed May 20, 2016
2 parents 1bf88ea + 04213c6 commit a1b8c4b
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
<!-- /copy -->
</div>
<!-- /footer -->
<p class="pagetop" style="display: none;"><a href="#content_top"><i class="fa fa-arrow-up" aria-hidden="true"></i></a></p>
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<script type="text/javascript" src="<%= request.getContextPath() %>/bower/notify.js/notify.js"></script>
<script type="text/javascript" src="<%= request.getContextPath() %>/bower/jquery-oembed-all/jquery.oembed.js"></script>

<script type="text/javascript" src="<%= jspUtil.mustReloadFile("/js/common.js") %>"></script>


<script type="text/javascript">
var _CONTEXT = '<%= request.getContextPath() %>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</ol>
--%>

<div class="container">
<div class="container" id="content_top">
${param.PARAM_CONTENT}
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</div>
</div>

<div class="container">
<div class="container" id="content_top">
${param.PARAM_CONTENT}
</div>

Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/WEB-INF/views/commons/layout/layoutTop.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@

<body>


<div id="content_top" style="margin: 0;padding: 0;">
${param.PARAM_CONTENT}
</div>


<c:import url="/WEB-INF/views/commons/layout/commonFooter.jsp" />
Expand Down
40 changes: 39 additions & 1 deletion src/main/webapp/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,42 @@ body {

.menu_list li {
margin-top: 10px;
}
}


.pagetop {
display: none;
position: fixed;
bottom: 30px;
right: 30px;
}
.pagetop a {
border-radius: 30px;
width: 60px;
height: 60px;
display: block;
text-align: center;
vertical-align: middle;
background-color: #666699;
color: white;
font-size: 20px;
text-decoration: none;
padding:15px 10px;
}

.pagetop a:hover {
border-radius: 30px;
width: 60px;
height: 60px;
display: block;
text-align: center;
vertical-align: middle;
background-color: #333366;
color: #fff;
font-size: 20px;
text-decoration: none;
padding:15px 10px;
}



17 changes: 17 additions & 0 deletions src/main/webapp/js/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$(document).ready(function() {
var pagetop = $('.pagetop');
$(window).scroll(function() {
if ($(this).scrollTop() > 100) {
pagetop.fadeIn();
} else {
pagetop.fadeOut();
}
});
pagetop.click(function() {
$('body, html').animate({
scrollTop : 0
}, 500);
return false;
});

});

0 comments on commit a1b8c4b

Please sign in to comment.