/app/libs/owlcarousel/README.md

https://bitbucket.org/zolotariuk/zolotariukosfacad · Markdown · 106 lines · 69 code · 37 blank · 0 comment · 0 complexity · cc5fcfd759c8829a490a28e6ab0a6119 MD5 · raw file

  1. # OwlCarousel2 is currently being transferred to a new owner
  2. Stay tuned while the new owner sorts through some stuff. (Oh, hi, I'm [David](https://github.com/daviddeutsch)!)
  3. ## Owl Carousel 2
  4. 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/.**
  5. ## Quick start
  6. ### Install
  7. This package can be installed with:
  8. - [npm](https://www.npmjs.com/package/owl.carousel): `npm install --save owl.carousel`
  9. - [bower](http://bower.io/search/?q=owl.carousel): `bower install --save owl.carousel`
  10. Or download the [latest release](https://github.com/OwlCarousel2/OwlCarousel2/releases).
  11. ### Load
  12. #### Webpack
  13. Load the required stylesheet and JS:
  14. ```js
  15. import 'owl.carousel/dist/assets/owl.carousel.css';
  16. import $ from 'jquery';
  17. import 'imports?jQuery=jquery!owl.carousel';
  18. ```
  19. #### Static HTML
  20. Put the required stylesheet at the [top](https://developer.yahoo.com/performance/rules.html#css_top) of your markup:
  21. ```html
  22. <link rel="stylesheet" href="/node_modules/owl.carousel/dist/assets/owl.carousel.min.css" />
  23. ```
  24. ```html
  25. <link rel="stylesheet" href="/bower_components/owl.carousel/dist/assets/owl.carousel.min.css" />
  26. ```
  27. **NOTE:** If you want to use the default navigation styles, you will also need to include `owl.theme.default.css`.
  28. Put the script at the [bottom](https://developer.yahoo.com/performance/rules.html#js_bottom) of your markup right after jQuery:
  29. ```html
  30. <script src="/node_modules/jquery/dist/jquery.js"></script>
  31. <script src="/node_modules/owl.carousel/dist/owl.carousel.min.js"></script>
  32. ```
  33. ```html
  34. <script src="/bower_components/jquery/dist/jquery.js"></script>
  35. <script src="/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>
  36. ```
  37. ### Usage
  38. 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:
  39. ```html
  40. <div class="owl-carousel owl-theme">
  41. <div> Your Content </div>
  42. <div> Your Content </div>
  43. <div> Your Content </div>
  44. <div> Your Content </div>
  45. <div> Your Content </div>
  46. <div> Your Content </div>
  47. <div> Your Content </div>
  48. </div>
  49. ```
  50. **NOTE:** The `owl-theme` class is optional, but without it, you will need to style navigation features on your own.
  51. Call the [plugin](https://learn.jquery.com/plugins/) function and your carousel is ready.
  52. ```javascript
  53. $(document).ready(function(){
  54. $('.owl-carousel').owlCarousel();
  55. });
  56. ```
  57. ## Documentation
  58. 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.
  59. ## Building
  60. This package comes with [Grunt](http://gruntjs.com/) and [Bower](http://bower.io/). The following tasks are available:
  61. * `default` compiles the CSS and JS into `/dist` and builds the doc.
  62. * `dist` compiles the CSS and JS into `/dist` only.
  63. * `watch` watches source files and builds them automatically whenever you save.
  64. * `test` runs [JSHint](http://www.jshint.com/) and [QUnit](http://qunitjs.com/) tests headlessly in [PhantomJS](http://phantomjs.org/).
  65. To define which plugins are build into the distribution just edit `/_config.json` to fit your needs.
  66. ## Contributing
  67. Please read [CONTRIBUTING.md](CONTRIBUTING.md).
  68. ## License
  69. The code and the documentation are released under the [MIT License](LICENSE).