Multiple jCarousel

Size
2,461 Kb
Views
24,288

How do I make an multiple jcarousel?

What is a multiple jcarousel? How do you make a multiple jcarousel? This script and codes were developed by Pavel Belousov on 26 August 2022, Friday.

Multiple jCarousel Previews

Multiple jCarousel - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>multiple jCarousel</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Множественные карусельки jCarousel</h1>
<h3>Карусель проматывается по одному элементу</h3>
<div class="main_wrap">	<div class="carousel_wrap">	<ul>	<li><img src="http://lorempixel.com/100/101" alt=""></li>	<li><img src="http://lorempixel.com/100/102" alt=""></li>	<li><img src="http://lorempixel.com/100/103" alt=""></li>	<li><img src="http://lorempixel.com/100/101" alt=""></li>	<li><img src="http://lorempixel.com/100/102" alt=""></li>	<li><img src="http://lorempixel.com/100/103" alt=""></li>	<li><img src="http://lorempixel.com/100/101" alt=""></li>	<li><img src="http://lorempixel.com/100/102" alt=""></li>	<li><img src="http://lorempixel.com/100/103" alt=""></li>	</ul>	</div>	<span class="btn jcarousel-prev" data-scroll="1"><<</span>	<span class="btn jcarousel-next" data-scroll="1">>></span>	</div> <h3>Карусель проматывается по два элемента</h3>	<div class="main_wrap">	<div class="carousel_wrap big">	<ul>	<li><img src="http://lorempixel.com/200/201" alt=""></li>	<li><img src="http://lorempixel.com/200/202" alt=""></li>	<li><img src="http://lorempixel.com/200/203" alt=""></li>	<li><img src="http://lorempixel.com/200/201" alt=""></li>	<li><img src="http://lorempixel.com/200/202" alt=""></li>	<li><img src="http://lorempixel.com/200/203" alt=""></li>	<li><img src="http://lorempixel.com/200/201" alt=""></li>	<li><img src="http://lorempixel.com/200/202" alt=""></li>	<li><img src="http://lorempixel.com/200/203" alt=""></li>	</ul>	</div>	<span class="btn jcarousel-prev" data-scroll="2"><<</span>	<span class="btn jcarousel-next" data-scroll="2">>></span>	</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://raw.github.com/jsor/jcarousel/master/dist/jquery.jcarousel.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Multiple jCarousel - Script Codes CSS Codes

.carousel_wrap {	position: relative;	overflow: hidden;	width: 300px;	height: 100px;	}	.carousel_wrap ul {	width: 20000em;	position: absolute;	list-style: none;	margin: 0;	padding: 0;	}	.carousel_wrap li {	float: left;	width: 100px;	height: 100px;	}	.btn {	display: inline-block;	padding: 5px;	margin: 0 5px -25px 0;	cursor: pointer;	color: #f96;	}	.btn.disabled {	color: #ccc;	cursor: default;	}	.carousel_wrap.big {	width: 600px;	height: 200px;	}	.carousel_wrap.big li {	width: 200px;	height: 200px;	}

Multiple jCarousel - Script Codes JS Codes

jQuery(document).ready(function($) {	$('.carousel_wrap').jcarousel();	$('.jcarousel-prev').each(function(p) {	$(this).on('active.jcarouselcontrol', function() {	$(this).removeClass('disabled'); //если ещё есть куда проматывать - удаляем касс disabled	})	.on('inactive.jcarouselcontrol', function() {	$(this).addClass('disabled'); //если перематывать дальше не куда - добавляем касс disabled	})	.jcarouselControl({target: '-='+$(this).data('scroll')}) //крутим на заданное в атрибуте data-scroll="X" количество элементов	});	$('.jcarousel-next').each(function(n) {	$(this).on('active.jcarouselcontrol', function() {	$(this).removeClass('disabled'); //если ещё есть куда проматывать - удаляем касс disabled	})	.on('inactive.jcarouselcontrol', function() {	$(this).addClass('disabled'); //если перематывать дальше не куда - добавляем касс disabled	})	.jcarouselControl({target: '+='+$(this).data('scroll')}) //крутим на заданное в атрибуте data-scroll="X" количество элементов	});	});
Multiple jCarousel - Script Codes
Multiple jCarousel - Script Codes
Home Page Home
Developer Pavel Belousov
Username pafnuty
Uploaded August 26, 2022
Rating 3
Size 2,461 Kb
Views 24,288
Do you need developer help for Multiple jCarousel?

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!

Pavel Belousov (pafnuty) Script Codes
Create amazing captions with AI!

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!