JSDM

HTML

4
 
1
div.wrap
2
  a#top i'm top(scroll through the wrap)
3
a(href="#top").goTop1 back to the top
4
a.goTop2 go to top
!

CSS

x
 
1
body
2
  height:2000px
3
  background:#0b2431
4
  color:#9cd8ed
5
.wrap
6
  text-align:center;
7
.goTop1
8
  position:fixed;
9
  top:50%;
10
  left:30%;
11
  width:40px;
12
  height:80px;
13
  background:#1e3745
14
  color:#9cd8ed
15
  text-decoration:none
16
  text-align:center
17
.goTop2
18
  position:fixed;
19
  top:50%;
20
  left:50%;
21
  width:30px;
22
  height:80px;
23
  background:#1e3745
24
  color:#9cd8ed
25
  text-align:center
26
  cursor:pointer
27
  display:none
28
!
? ?
? ?
必须是有效的URL
+ 添加另一个资源

JS

13
 
1
var goTop = $('.goTop2');
2
  $(window).scroll(function() {
3
    if ($(window).scrollTop() > 100) {
4
      $(goTop).fadeIn("slow");
5
    } else {
6
      $(goTop).fadeOut("slow");
7
    }
8
  })
9
  goTop.click(function() {
10
    $('html, body').animate({
11
      scrollTop : 0
12
    }, 200);
13
  })
!
必须是有效的URL
+ 添加另一个资源
Close

文件管理 点击文件查看URL

图片

  1. 暂无文件

CSS

  1. 暂无文件

JavaScript

  1. 暂无文件

其他

  1. 暂无文件
拖动文件到上面的区域或者:
加载中 ..................