i've been looking around a lot on how to do different carousels, but i'm struggling to find a resource that teaches me what it actually does instead of just throwing code at me. Time wasted on misleading videos where you have to download their special script at the end! :-(
i want to understand it first in vanilla JS/Css first, and then work towards understanding Pug/Scss.
i have the below:
.MenuContainer {
position: relative;
width: 300px;
height: 175px;
background-color: black;
border-radius: 10px;
}
.Imagebox {
height: 150px;
margin-top: 15px;
margin-bottom: 27px;
bottom: -17px;
width: 260px;
margin-left: 20px;
margin-right: 15px;
background-color: lavender;
align-self: center;
position: absolute;
border-radius: 5px;
}
.ListReel {
position: inherit;
height: 120px;
background-color: white;
width: 217px;
bottom: 8px;
margin-left: 20px;
display: flex;
flex-direction: row;
overflow-x: hidden;
justify-content: space-evenly;
}
.fa-chevron-left {
position: inherit;
left: 30px;
bottom: 93px;
font-size: 1.5em;
}
.fa-chevron-right {
position: inherit;
left: 236px;
bottom: 93px;
font-size: 1.5em;
}
.MenuItem {
position: inherit;
height: 85px;
width: 85px;
top: 1px;
position: inherit;
border-color: lawngreen;
border-style: solid;
border-width: 1px;
display: table-row;
}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://kit.fontawesome.com/a427ef628d.js" crossorigin="anonymous"></script>
<script src="../Scripts/JQuery"></script>
<script src="../Scripts/jquery-ui.min.js"></script>
<link rel="stylesheet" href="../Scripts/jquery-ui.min.css">
<link rel="stylesheet" href="Test.css">
<title>TESTING</title>
</head>
<body>
<h1>Hello!</h1>
<div class="MenuContainer">
<h5 style="text-align: center; margin-top: 5px; color: white;">Select Item</h5>
<div class="Imagebox"></div>
<ul class=ListReel>
<li class="MenuItem"></li>
<li class="MenuItem"></li>
<li class="MenuItem"></li>
<li class="MenuItem"></li>
<li class="MenuItem"></li>
<li class="MenuItem"></li>
</ul>
<i class="fas fa-chevron-left"></i>
<i class="fas fa-chevron-right"></i>
</div>
</body>
</html>
I tried going my own way but i'm completely stuck - i envision that the green boxes will need to be spaced evenly, and in a straight row, the items that fall outside the box, won't be visisble and the scroll will cycle the items "Carousel" style..
Ive tried a lot of things so far and i cant even seem to be able to flex my container/green boxes across let alone make a start on the animation!
Does anyone have any tips or resources or code ideas that can point me in the correct direction? preferably well explained tutorials? please?
Many Thanks