# Hiệu tứng scroll cực chất (ok)

```
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<style>
	#wrap {
		width: 100%;
		height: 1000px;
	}
	#btn-top {
		display: none;
	    background-color: red;
	    width: 50px;
	    height: 50px;
	    position: fixed;
	    right: 10px;
	    bottom: 10px;
	}
</style>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script>
	jQuery(window).scroll(function(){
		if(jQuery(this).scrollTop()>300){
		 	jQuery('#btn-top').fadeIn('slow');
		}else{
		 	jQuery('#btn-top').fadeOut('slow');
		}
	});
</script>
<body>
	<div id="wrap">
		<div id="btn-top"></div>
	</div>
</body>
</html>
```

![Hình ảnh khi croll chuột](https://2494213435-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYjAG13rAPdbArSfRyB%2F-LfrZTwXYjwEuK2aSkge%2F-LfrZXqIoBEuuwUpUahX%2FScreenshot_1.png?alt=media\&token=cd5c87b0-07b0-406e-862e-9c1f994e5646)
