Created
August 22, 2019 08:38
-
-
Save akiyamaSM/96c84a058b332994aa1f0a10a8391071 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<style> | |
.container{ | |
background-color: cornflowerblue; | |
position: relative; | |
max-height: 500px; | |
overflow-y: scroll; | |
width: 700px; | |
margin: auto; | |
} | |
.sous{ | |
border-top: gray solid 1px; | |
height: 300px; | |
} | |
.menu{ | |
position: absolute; | |
left: -10px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container" onscroll="onScroll(this)"> | |
<div class="menu"> | |
<ul> | |
<li> One </li> | |
<li> two </li> | |
<li> three </li> | |
</ul> | |
</div> | |
<div class="sous" id="s1"> | |
<h1>Title</h1> | |
</div> | |
<div class="sous" id="s2"> | |
<h1>Title</h1> | |
</div> | |
<div class="sous" id="s3"> | |
<h1>Title</h1> | |
</div> | |
</div> | |
<script> | |
function onScroll(o) { | |
debugger; | |
/*if(o.offsetHeight + o.scrollTop == o.scrollHeight) | |
{ | |
alert("End"); | |
}*/ | |
} | |
function selected() { | |
console.log('entred'); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment