# Owl Carousel 2
Touch enabled [jQuery](https://jquery.com/) plugin that lets you create a beautiful, responsive carousel slider. **To get started, check out https://owlcarousel2.github.io/OwlCarousel2/.**
## Quick start
### Install
This package can be installed with:
- [npm](https://www.npmjs.com/package/owl.carousel): `npm install --save owl.carousel` or `yarn add owl.carousel jquery`
- [bower](http://bower.io/search/?q=owl.carousel): `bower install --save owl.carousel`
Or download the [latest release](https://github.com/OwlCarousel2/OwlCarousel2/releases).
### 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:
```js
import 'owl.carousel/dist/assets/owl.carousel.css';
import 'owl.carousel';
```
#### Static HTML
Put the required stylesheet at the [top](https://developer.yahoo.com/performance/rules.html#css_top) of your markup:
```html
<link rel="stylesheet" href="/node_modules/owl.carousel/dist/assets/owl.carousel.min.css" />
```
```html
<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](https://developer.yahoo.com/performance/rules.html#js_bottom) of your markup right after jQuery:
```html
<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/node_modules/owl.carousel/dist/owl.carousel.min.js"></script>
```
```html
<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:
```html
<div class="owl-carousel owl-theme">
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
</div>
```
**NOTE:** The `owl-theme` class is optional, but without it, you will need to style navigation features on your own.
Call the [plugin](https://learn.jquery.com/plugins/) 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](http://assemble.io/) and publicly available at https://owlcarousel2.github.io/OwlCarousel2/. The documentation may also be run locally.
## Building
This package comes with [Grunt](http://gruntjs.com/) and [Bower](http://bower.io/). 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](http://www.jshint.com/) and [QUnit](http://qunitjs.com/) tests headlessly in [PhantomJS](http://phantomjs.org/).
To define which plugins are build into the distribution just edit `/_config.json` to fit your needs.
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md).
## Roadmap
Please make sure to check out our [Roadmap Discussion](https://github.com/OwlCarousel2/OwlCarousel2/issues/1756).
## License
The code and the documentation are released under the [MIT License](LICENSE).
风月歌
- 粉丝: 1710
- 资源: 5159
最新资源
- 横观水力压裂模型 pde建模 横观各向同性介质水力压裂裂纹扩展模型 使用comsol软件实现相场法模拟裂纹扩展 均基于断裂力学理论 模拟单边拉裂纹受拉伸荷载作用和受剪切荷载作用 考虑初始地应力场作用下
- 无纺布复卷检测机sw18可编辑全套技术资料100%好用.zip
- ACC自适应巡航控制模型 直 弯路控制 制动油门 安全距离计算(Simulink与PreScan联合仿真),ADS仿真模型(模型详细清晰,能够快速提升个人水平),奥迪A8 智能驾驶L2级别模型,做智能
- 相贯线焊接机sw12可编辑全套技术资料100%好用.zip
- 基于AD9361的DPSK调制解调器、位同步、误码率测试demo 零中频架构,适用于AD9361等软件无线电平台,带AD9361纯逻辑FPGA驱动,verilog代码,Vivado 2019.1工程
- 物流搬运机器人sw18可编辑全套技术资料100%好用.zip
- comsol计算光子晶体平带合并BIC,复现包含二维能带,三维能带,品质因子和远场偏振计算
- 洗瓶机的简易设计全套技术资料100%好用.zip
- C#开发的运动控制框架源码,用的凌华板卡加总线IO模块,有简单说明文档
- 三维电介质介电击穿模型 comsol相场模拟电树枝 采用三维模型模拟电介质在电场作用下介电击穿电树枝分布,电场分布和电势分布,介电击穿系列-纯聚合物电树枝生长,相场法comsol模拟,采用麦克斯韦方程
- 基于神经网络的冰数据集时间序列分析-Neural Network-based Time Series Analysis of Ice Dataset-matlab
- simpack轨道车辆建模 动力学模型 直线和曲线的动力学评价 simpack批处理变参分析,全自动preload,后台计算 matlab-simpack联合仿真批处理计算 simpack远程指导 s
- 晶体塑性有限元后处理相关脚本文件
- 1.采用matlab代码构建三维多晶模型 2.赋予模型中不同晶粒相应的取向 3.批量化输入材料参数 4.生成对应inp文件 另外,还包括黄永刚晶体塑性模型的理lunwen件和for文件,自己整理的晶体
- 新型破碎机sw17全套技术资料100%好用.zip
- addUser.jsp
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈