HTML 끝

1775 단어 html



	
	<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"/>
	<script>
		$(document).ready(function () {
			// #back-to-top 
			$("#back-to-top").hide();
			// 600 , , 
			$(function () {
				$(window).scroll(function () {
					if ($(window).scrollTop() > 300) {
						$("#back-to-top").fadeIn(500);
					} else {
						$("#back-to-top").fadeOut(500);
					}
				});
				// , 
				$("#back-to-top").click(function () {
					$('body,html').animate({
						scrollTop: 0
					}, 500);
					return false;
				});
			});
		});
	</script>
	<style>
		body {
			height: 2000px;
		}

		p#back-to-top {
			position: fixed;
			bottom: 18px;
			right: 12px;
		}

		p#back-to-top a {
			text-align: center;
			text-decoration: none;
			color: #000;
			display: block;
			width: 30px;
			/* CSS3 transition */
			-moz-transition: color1s;
			-webkit-transition: color1s;
			-o-transition: color1s;
		}

		p#back-to-top a:hover {
			color: #000011;
		}

		p#back-to-top a span {
			background-color: #d4bbbb;
			z-index: -100;
			border: 1px solid #cccccc;
			border-radius: 6px;
			display: block;
			height: 30px;
			width: 30px;
			margin-bottom: 5px;
			/* CSS3 transition <span> */
			-moz-transition: background1s;
			-webkit-transition: background1s;
			-o-transition: background1s;
		}

		#back-to-top a:hover span {
			background-color: #f0f0f0;
		}
	</style>



	<p id="back-to-top">
		<a href="#top">
			<span>
				<i class="fa fa-chevron-up" aria-hidden="true"/>
			</span>
		</a>
	</p>



</code></pre></div></div></div></div>

좋은 웹페이지 즐겨찾기