티스토리 뷰
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <p id="back-top"> <a href="#top"><span></span>Back to Top</a> </p> <style> body { font: .88em/150% Arial, Helvetica, sans-serif; margin: 30px auto; } h1 { font: bold 80%/120% Arial, Helvetica, sans-serif; text-transform: uppercase; margin: 0 0 10px; color: #999; } h2 { font-size: 2.5em; margin: 0 0 8px; } h3 { font-size: 1.6em; margin: 20px 0 5px; } a { color: #69C; text-decoration: none; } a:hover { color: #F30; } p { margin: 0 0 10px; } em { font: italic 100% "Times New Roman", Times, serif; } .credits { border-bottom: solid 1px #eee; padding-bottom: 10px; margin: 0 0 30px; } #pagewrap { margin: 0 auto; width: 600px; padding-left: 150px; position: relative; } /* Back to top button */ #back-top { position: fixed; bottom: 30px; margin-left: -150px; } #back-top a { width: 108px; display: block; text-align: center; font: 11px/100% Arial, Helvetica, sans-serif; text-transform: uppercase; text-decoration: none; color: #bbb; /* background color transition */ -webkit-transition: 1s; -moz-transition: 1s; transition: 1s; } #back-top a:hover { color: #000; } /* arrow icon (span tag) */ #back-top span { width: 108px; height: 108px; display: block; margin-bottom: 7px; background: #ddd url(up-arrow.png) no-repeat center center; /* rounded corners */ -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; /* background color transition */ -webkit-transition: 1s; -moz-transition: 1s; transition: 1s; } #back-top a:hover span { background-color: #777; } </style> | cs |
]JS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
// hide #back-top first
$("#back-top").hide();
// fade in #back-top
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#back-top').fadeIn();
} else {
$('#back-top').fadeOut();
}
});
// scroll body to 0px on click
$('#back-top a').click(function () {
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
});
});
</script>
|
cs |
[자료출처 : webdesignerwall.com/tutorials/animated-scroll-to-top]
'WEB > JQuery' 카테고리의 다른 글
CSS 벤더프리픽스 (0) | 2021.06.12 |
---|---|
[이미지 슬라이드 jQuery] slick slider (0) | 2021.06.12 |
[이미지 슬라이드 jQuery] RoyalSilder (유료) (0) | 2021.05.07 |
[이미지 슬라이드 jQuery] owlcarousel (0) | 2021.05.06 |
[이미지 슬라이드 jQuery] swiperjs (0) | 2021.05.05 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- css미디어쿼리 #미디어쿼리 #mediaquery
- sw기술자평균임금 #2025년 sw기술자 평균임금
- 연명의료결정제도 #사전연명의료의향서 #사전연명의료의향서등록기관 #광주사전연명의료의향서
- echart
- jdk #jre
- jQuery #jQuery이미지슬라이드 #이미지슬라이드
- 증폭기 #아이피타임증폭기
- 와이파이약할때
- 자바스크립트countiue
- 광주분식 #광주분식맛집 #상추튀김 #상추튀김맛집 #광주상추튀김
- 썬크림 #닥터지썬크림 #내돈내산 #내돈내산썬크림 #썬크림추천 #spf50썬크림 #닥터지메디유브이울트라선
- 무료폰트 #무료웹폰트 #한수원한돋움 #한수원한울림 #한울림체 #한돋움체
- 와이파이신호 #와이파이 #와이파이신호세게
- 좋은책 #밥프록터 #부의원리
- iptime와이파이증폭기 #와이파이증폭기설치
- 테스크탑무선랜카드 #무선랜카드 #아이피타이무선랜카드 #a3000mini #무선랜카드추천
- thymeleaf
- 쇼팬하우어 #좋은책
- 자바스크립트 #javascript #math
- 와이파이증폭기추천 #와이파이설치
- 좋은책
- 자바스크립트break
- 자바스크립트정규표현식
- 파비콘 #파비콘 사이트에 적용
- SQL명령어 #SQL
- ajax
- 정보처리기사 #정보처리기사요약 #정보처리기사요점정리
- 파비콘사이즈
- lg그램pro #lg그램 #노트북 #노트북추천 #lg노트북
- 바지락칼국수 #월곡동칼국수 #칼국수맛집
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함