<!doctype html>
<
html
>
<
head
>
<
meta
charset
=
"UTF-8"
>
<
title
>top scrolling</
title
>
<
style
>
body {
margin: 0;
}
.container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
aside {
position: fixed;
top: 0;
left: 0;
bottom: 0;
width: 200px;
background-color: orange;
}
article {
position: absolute;
top: 0;
width: 1000px;
right: 0;
height: 1200px;
background-color: yellow;
}
#btn-top {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 100px;
background-color: red;
cursor: pointer;
}
</
style
>
<
script
>
$(document).ready(function(){
$("#btn-top").click(function(){
$("html, body").animate({
scrollTop: 0
});
});
});
</
script
>
</
head
>
<
body
>
<
div
class
=
"container"
>
<
aside
></
aside
>
<
article
>
<
div
id
=
"btn-top"
></
div
>
</
article
>
</
div
>
</
body
>
</
html
>