GithubHelp home page GithubHelp logo

rtpharry / bootstrap3-showmanyslideonecarousel Goto Github PK

View Code? Open in Web Editor NEW
39.0 6.0 32.0 42 KB

A sample showing how to configure the Bootstrap 3 carousel to show many panels at once but only slide one at a time

License: MIT License

HTML 69.92% JavaScript 30.08%

bootstrap3-showmanyslideonecarousel's Introduction

Bootstrap3-ShowManySlideOneCarousel

This is a sample showing how to configure the Bootstrap 3 carousel to show many panels at once but only slide one at a time.

Online Demo

I have put these up on two popular interactive playgrounds:

Description

This is a modification to the standard Bootstrap carousel which lets you show four panels at once but only slides them along one panel at a time. Check out one of the demos above to get more of a feel for the effect.

It is responsive and modifies the number of panels shown at a time on smaller screens.

I found the original concept on Bootply but unfortunately tracing it back as far as the thread went back to one that started out with an anon post. This version is now almost a complete rewrite and incorporates many fixes but I do owe credit to the unknown author that made the original breakthrough.

This version has been updated to fix animation bugs and make it compatible with Bootstrap again now that it has moved to using css transitions for its animations.

I've added in a Less stylesheet which means you can easily update the container name and make changes to the numbers of columns (guide in the wiki).

I've also optimised the JavaScript code to remove redundant calls and wrap it up safely.

Quickstart - I don't use NPM, Git, Grunt, Less or any of those technologies

You should take some time to learn them but I'm not going to make you do it right now just so that you can use this in your project!

Your best bet is to load up the sample on CodePen

  1. Copy the html and JavaScript over to your project
  2. In the CSS (Less) panel look in the top right for a small eye symbol. Clicking this will compile the Less into CSS so you can use it without having any special software installed.

Installing - Git

You can install a copy of this by typing this into your command line terminal:

> git clone https://github.com/rtpHarry/Bootstrap3-ShowManySlideOneCarousel.git

Installing - Download

Download the latest release from GitHub

Rebuilding after you have made changes

If you make some tweaks to the JavaScript or Less files you can quickly regenerate them.

Using your command line terminal, navigate to the folder that has the gruntfile.js/package.json in. Enter the following command:

> grunt dev

To generate the unminimised JS and CSS files with a CSS source map for debugging, or

> grunt dist

To create the minified versions.

You will find the project files in the /dist/ folder.

Customisation - Changing the number of slides visible at any one time

This is quite easy but it involves editing both the LESS/CSS and the JS files so I have put this in a wiki item:

Browser Compatibility

I've tested it in:

  • Chrome 41
  • Firefox 36.0.4
  • Internet Explorer 11

Improvements

If you have feedback, please open an issue or initiate a pull request. I'm happy to make improvements where possible.

Website

There is a blog post announcing this but all the information you need is in this repo:

Release History

v1.0 - 27-Mar-2015 - Initial release

License

This software is released under the MIT License.

I just picked it because its an unrestrictive one but as this is based in part on Bootstrap I think I might be tied to it. If this causes issues with your project please open an issue on GitHub and we can look into it.

bootstrap3-showmanyslideonecarousel's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bootstrap3-showmanyslideonecarousel's Issues

Not working offline

The demo works for me at all the links online (bootply, codepen, your test url), but when I download it I only see 1 item at a time in the carousel

screen shot 2015-05-19 at 11 06 44 pm

Ideas? Thanks!

sliding all instead of one

I'm using bootstrap 3.3.7...

If I take your base code in a blank html page, when I click left or right, what happens is that instead of 1 sliding off and 5 sliding on, 1,2,3,4 slide off, and 2, 3, 4, 5 slide on...

Not sure what is generating this issue - I'm assuming its something with the slight increase in bootstrap - but I need to be on 3.3.7 for this...

Hoping something triggers to help me figure out what the issue is...

Weird padding issue and images showing up multiple times

First off, thanks for doing probably the best version of this carousel extension.

However, I seem to have some weird isue with it. When the items are being moved, their padding gets messed up, and sometimes, parts of some images get shown twice. When moving is done, it all goes back to normal.

I tried setting solid color background to all .item and its children elements, hoping that it is an issue casued by me seeing the next slide, and I tried setting paddings to 0, but to no avail.

I am using 4 240px wide images in a carousel with max-width 1170px at the most.

See the attached files
carousel_bug_2

On the "color mess" picture (full screen size)

carousel_bug

On the dog picture (smaller window)

Happens in Firefox and Chrome, so probably everywhere...

Thanks for any help you can provide...

6 across

Thank you for sharing this. I am trying to get it to work with six across and it works on desktop. But on mobile it is stacking items. Do you know what I would change to hide the stacked items?

http://codepen.io/JacobLett/pen/PGZKZz

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.