Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<head>
<style>
#container {
  width: 80%;
  aspect-ratio: 2/1;
  margin: 30px auto;
  border: solid black 2px;
  overflow-x: hidden;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}
.blue {
  background-color: lightblue;
  width: 90%;
}
.green {
  background-color: lightgreen;
  width: 80%;
}
.pink {
  background-color: lightpink;
  width: 70%;
}
#container > div{
  margin: 5px;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
  aspect-ratio: 4/1;
}
</style>
</head>
<body>
<h1>Change scroll-snap-stop property with JavaScript</h1>