Click-activated fluid width slider
How do I make an click-activated fluid width slider?
What is a click-activated fluid width slider? How do you make a click-activated fluid width slider? This script and codes were developed by Jesper Hills on 13 October 2022, Thursday.
Click-activated fluid width slider - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Click-activated fluid width slider</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { overflow: hidden;
}
.carousel { width: 50%; position: relative; margin: 40px auto;
}
.viewport { width: 100%; height: 100%; position: absolute; top: 0; left: 0;
}
ul { width: 400%; height: 100%; position: absolute; overflow: hidden; top: 0; left: 0; transition: left 1s;
}
li { width: 25%; height: 100%; float: left; opacity: 0.5; cursor: pointer; position: relative; transition: opacity 0.3s; display: table;
}
li:hover, li.active { opacity: 1;
}
li span { display: table-cell; position: relative; height: 100%; vertical-align: middle;
}
li img { width: 68%; display: block; margin: 0 auto; transition: width 1s, left 0.2s, right 0.2s; position: relative;
}
img.setter { display: block; width: 100%; height: 100%; position: relative; visibility: hidden; }
li.active img { margin: 0 auto; width: 100%; top: 0; left: 0 !important; right: 0 !important; } </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="carousel"> <img class="setter" src="//placehold.it/600x400" /> <div class="viewport"> <ul> <li class="active"> <span><img src="//placehold.it/600x400" /></span> </li> <li class="n"> <span><img src="//placehold.it/600x400" /></span> </li> <li> <span><img src="//placehold.it/600x400" /></span> </li> <li> <span><img src="//placehold.it/600x400" /></span> </li> </ul> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Click-activated fluid width slider - Script Codes CSS Codes
body { overflow: hidden;
}
.carousel { width: 50%; position: relative; margin: 40px auto;
}
.viewport { width: 100%; height: 100%; position: absolute; top: 0; left: 0;
}
ul { width: 400%; height: 100%; position: absolute; overflow: hidden; top: 0; left: 0; transition: left 1s;
}
li { width: 25%; height: 100%; float: left; opacity: 0.5; cursor: pointer; position: relative; transition: opacity 0.3s; display: table;
}
li:hover, li.active { opacity: 1;
}
li span { display: table-cell; position: relative; height: 100%; vertical-align: middle;
}
li img { width: 68%; display: block; margin: 0 auto; transition: width 1s, left 0.2s, right 0.2s; position: relative;
}
img.setter { display: block; width: 100%; height: 100%; position: relative; visibility: hidden; }
li.active img { margin: 0 auto; width: 100%; top: 0; left: 0 !important; right: 0 !important; }
Click-activated fluid width slider - Script Codes JS Codes
var carousel = { item: $(".carousel li"), list: $(".carousel ul")
};
carousel.item.on("click", function(){ var el = $(this); carousel.list.css({ "left": "-"+(el.index()*100)+"%" }); carousel.item.removeClass(); el.addClass("active"); el.prev().addClass("p"); el.next().addClass("n");
});
Developer | Jesper Hills |
Username | nopr |
Uploaded | October 13, 2022 |
Rating | 3 |
Size | 2,567 Kb |
Views | 10,120 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
CSS3 Text Masking | 2,609 Kb |
Triangular logo, scales to font size | 2,530 Kb |
CSS Fab Ice Cream | 1,947 Kb |
Mobile UI Concept | 3,761 Kb |
CSS Radar, variable speed | 4,382 Kb |
Full-height content with footer below fold | 2,350 Kb |
Mouseover carousel with indicator | 2,264 Kb |
A Pen by Jesper Hills | 2,738 Kb |
DRY-BEM with SCSS | 2,211 Kb |
CSS 3D Carousel | 2,986 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
A Pen by Xand0r | Xand0r | 1,928 Kb |
Nested table email layout | Massimo-cassandro | 2,355 Kb |
Gulpfile | Aimhigherwebdesign-amy | 1,765 Kb |
Css Rotating 3d cubes different speed | Dghez | 2,364 Kb |
Header Line Issue | Charlie-volpe | 1,768 Kb |
Hard-Stop Gradients | Mackdoyle | 2,288 Kb |
Price Comparison Table | Orrinward | 3,459 Kb |
Material design - button rainbow circle | Kunukn | 3,652 Kb |
Responsive Menu I | Rodericksandoval | 3,045 Kb |
A Pen by Malith Hettiarachchi | MalZiiirA | 5,531 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!