Giter Site home page Giter Site logo

two-row-carousel's Introduction

two-row-carousel

A work in progress jQuery plugin to support two row carousel.

Support

Tested in IE8+

  • CSS3 Flex-box has eliminated the need for this, but if you need to support IE8 this will work.
  • A caveat is that the UL list is halved to make 2 rows, so your items will be displayed out of order.

To Do: Dynamically add arrows and parent container.

SET-UP: The plug-in expects the following structure:

HTML:

<div id="slider">
		<ul id="carousel">
		<li>Add some li's</li>
		</ul>
</div>

CSS:

#slider {
	height: 612px; /*Very important*/
    margin: -4px 0 0;
    overflow: hidden;
}

#carousel {
    position: relative;
}

#carousel li {
	height: 304px;
	max-width: 308px;
	overflow: hidden;
	width: 100%;
	position: relative;
	float: left;
}

jQuery:

To instantiate: Link to jQuery, link to two Row Carousel, call it on your UL element.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/two.row.carousel.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				$('#carousel').twoRowCarousel();

			});
</script>

Optional Minification:

If you would like to option to modify the code and minify, run the following in your command line:

  • npm install > This will install uglifyjs
  • npm run minify > This will compile two.row.carousel.js > two.row.carousel.min.js by default
  • Edit the package.json if you want a different output name

Configuration options defaults:

		numberWide : 4,  //controls how many items wide you want each frame to be
		scrollSpeed : 300, //how fast you want the transition between frames to take
		container : $('#slider'), //the parent container name
		prev : $('.carousel_prev'), //previous arrow name
		next : $('.carousel_next') //next arrow name

two-row-carousel's People

Contributors

quartucm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.