Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

OwlCarousel2

> 编程语言
Open source

DEPRECATED jQuery Responsive Carousel.

7.9K stars0 likes3 views
WebsiteGitHub

About

DEPRECATED jQuery Responsive Carousel.

YEAH SO THIS IS PRETTY MUCH DEAD, DO YOURSELF A FAVOR AND SWITCH TO tiny-slider




Owl Carousel 2

Touch enabled jQuery plugin that lets you create a beautiful, responsive carousel slider. To get started, check out https://owlcarousel2.github.io/OwlCarousel2/.

Notice: The old Owl Carousel site (owlgraphic [dot] com) is no longer in use. Please delete all references to this in bookmarks and your own products' documentation as it's being used for malicious purposes.

Quick start

Install

This package can be installed with:

  • npm: npm install --save owl.carousel or yarn add owl.carousel jquery
  • bower: bower install --save owl.carousel

Or download the latest release.

Load

Webpack

Add jQuery via the "webpack.ProvidePlugin" to your webpack configuration:

const webpack = require('webpack');

//...
plugins: [
    new webpack.ProvidePlugin({
      $: 'jquery',
      jQuery: 'jquery',
      'window.jQuery': 'jquery'
    }),
],
//...

Load the required stylesheet and JS:

javascript
import 'owl.carousel/dist/assets/owl.carousel.css';
import 'owl.carousel';

Static HTML

Put the required stylesheet at the top of your markup:

xml
<link rel="stylesheet" href="/node_modules/owl.carousel/dist/assets/owl.carousel.min.css" />
xml
<link rel="stylesheet" href="/bower_components/owl.carousel/dist/assets/owl.carousel.min.css" />

NOTE: If you want to use the default navigation styles, you will also need to include owl.theme.default.css.

Put the script at the bottom of your markup right after jQuery:

xml
<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/node_modules/owl.carousel/dist/owl.carousel.min.js"></script>
xml
<script src="/bower_components/jquery/dist/jquery.js"></script>
<script src="/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>

Usage

Wrap your items (div, a, img, span, li etc.) with a container element (div, ul etc.). Only the class owl-carousel is mandatory to apply proper styles:

xml

  

  

  

  

  

  

</div>

NOTE: The owl-theme class is optional, but without it, you will need to style navigation features on your own.

Call the plugin function and your carousel is ready.

javascript
$(document).ready(function(){
  $('.owl-carousel').owlCarousel();
});

Documentation

The documentation, included in this repo in the root directory, is built with Assemble and publicly available at https://owlcarousel2.github.io/OwlCarousel2/. The documentation may also be run locally.

Building

This package comes with Grunt and Bower. The following tasks are available:

  • default compiles the CSS and JS into /dist and builds the doc.
  • dist compiles the CSS and JS into /dist only.
  • watch watches source files and builds them automatically whenever you save.
  • test runs JSHint and QUnit tests headlessly in PhantomJS.

To define which plugins are build into the distribution just edit /_config.json to fit your needs.

Contributing

Please read CONTRIBUTING.md.

Roadmap

Please make sure to check out our Roadmap Discussion.

License

The code and the documentation are released under the MIT License.

Issues· 1192 open

View all issuesOpen on GitHub
  • #2974

    How to repair white space?

    Updated Aug 30, 2026
  • #1925

    Uncaught TypeError: $(...).owlCarousel is not a function (even doing it properly)

    Updated Mar 10, 2026
  • #1378

    Linked OwlCarousel instances

    Updated Mar 10, 2026
  • #162

    Blured text problem

    bugUpdated Mar 10, 2026
  • #2935

    Can someone please tell me how to stop the owl carousel from auto scrolling. I have tried every setting but i can get to work. here are my two jave scripts. one of them seems to have the setting but i tried everything.

    Updated Mar 10, 2026
  • #2936

    Vertically arrange the carousel item is needed

    Updated Mar 10, 2026
  • #2937

    Kust slide from left to right when using loop

    Updated Mar 10, 2026
  • #2938

    My slider icon doesnt works

    Updated Mar 10, 2026
  • #2939

    How to combine center and stagePadding ?

    Updated Mar 10, 2026
  • #2940

    Swiping interferes with the animation.

    Updated Mar 10, 2026

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言