yukarı
 

Notlar

oWL / owl ayar 2

kaynak http://www.landmarkmlp.com/js-plugin/owl.carousel/#how-to

 

How To Use

1. Load jQuery and include Owl Carousel plugin files

To use Owl Carousel, you’ll need to make sure both the Owl and jQuery 1.7 or higher scripts are included.


 
  1. <!-- Important Owl stylesheet -->
  2. <link rel="stylesheet" href="owl-carousel/owl.carousel.css">
  3.  
  4. <!-- Default Theme -->
  5. <link rel="stylesheet" href="owl-carousel/owl.theme.css">
  6.  
  7. <!-- jQuery 1.7+ -->
  8. <script src="jquery-1.9.1.min.js"></script>
  9.  
  10. <!-- Include js plugin -->
  11. <script src="assets/owl-carousel/owl.carousel.js"></script>

2. Set up your HTML

You don't need any special markup. All you need is to wrap your divs(owl works with any type element) inside the container element <div class="owl-carousel">. Class "owl-carousel" is mandatory to apply proper styles that come from owl.carousel.css file.


 
  1. <div id="owl-example" class="owl-carousel">
  2. <div> Your Content </div>
  3. <div> Your Content </div>
  4. <div> Your Content </div>
  5. <div> Your Content </div>
  6. <div> Your Content </div>
  7. <div> Your Content </div>
  8. <div> Your Content </div>
  9. ...
  10. </div>

3. Call the plugin

Now call the Owl initializer function and your carousel is ready.


 
  1. $(document).ready(function() {
  2.  
  3. $("#owl-example").owlCarousel();
  4.  
  5. });

Customizing

1. Options

All of the options below are available to customize Owl Carousel.

Variable Default Type Description
items 5 int This variable allows you to set the maximum amount of items displayed at a time with the widest browser width
itemsDesktop [1199,4] array This allows you to preset the number of slides visible with a particular browser width. The format is [x,y] whereby x=browser width and y=number of slides displayed. For example [1199,4] means that if(window<=1199){ show 4 slides per page} Alternatively use itemsDesktop: false to override these settings. Check my Custom Demo
itemsDesktopSmall [979,3] array As above.
itemsTablet [768,2] array As above.
itemsTabletSmall false array As above. Default value is disabled.
itemsMobile [479,1] array As above
singleItem false boolean Display only one item. See demo
slideSpeed 200 int Slide speed in milliseconds
paginationSpeed 800 int Pagination speed in milliseconds
rewindSpeed 1000 int Rewind speed in milliseconds
autoPlay false int/boolean Change to any integrer for example autoPlay : 5000 to play every 5 seconds. If you set autoPlay: true default speed will be 5 seconds.
stopOnHover false boolean Stop autoplay on mouse hover
navigation false boolean Display "next" and "prev" buttons.
navigationText ["prev","next"] array You can cusomize your own text for navigation. To get empty buttons use navigationText : false. Also HTML can be used here
rewindNav true boolean Slide to first item. Use rewindSpeed to change animation speed.
scrollPerPage false boolean Scroll per page not per item.
pagination true boolean Show pagination.
paginationNumbers false boolean Show numbers inside pagination buttons
responsive true boolean You can use Owl Carousel on desktop-only websites too! Just change that to "false" to disable resposive capabilities
responsiveRefreshRate 200 int Check window width changes every 200ms for responsive actions
responsiveBaseWidth window jQuery selector Owl Carousel check window for browser width changes. You can use any other jQuery element to check width changes for example ".owl-demo". Owl will change only if ".owl-demo" get new width.
baseClass "owl-carousel" string Automaticly added class for base CSS styles. Best not to change it if you don't need to.
theme "owl-theme" string Default Owl CSS styles for navigation and buttons. Change it to match your own theme
lazyLoad false boolean Delays loading of images. Images outside of viewport won't be loaded before user scrolls to them. Great for mobile devices to speed up page loadings. IMG need special markup class="lazyOwl" and data-src="your img path"See example.
lazyFollow true boolean When pagination used, it skips loading the images from pages that got skipped. It only loads the images that get displayed in viewport. If set to false, all images get loaded when pagination used. It is a sub setting of the lazy load function.
autoHeight false boolean Add height to owl-wrapper-outer so you can use diffrent heights on slides. Use it only for one item per page setting.
jsonPath false string Allows you to load directly from a jSon file. The JSON structure you use needs to match the owl JSON structure used here. To use custom JSON structure see jsonSuccess option.
jsonSuccess false function Success callback for $.getJSON build in into carousel. See demo with custom JSON structure here.
mouseDrag true boolean Turn off/on mouse events.
touchDrag true boolean Turn off/on touch events.
addClassActive false boolean Add "active" classes on visible items. Works with any numbers of items on screen.
transitionStyle false string Add CSS3 transition style. Works only with one item on screen. See Demo

2. Callbacks

Variable Default Type Description
beforeInit false function Before initialization callback
afterInit false function After initialization callback
beforeMove false function Before move callback
afterMove false function After move callback
afterAction false function After startup, move and update callback
startDragging false function Call this function while dragging.

3. Defaults

Carousel default settings


 
  1. $("#owl-example").owlCarousel({
  2.  
  3. // Most important owl features
  4. items : 5,
  5. itemsDesktop : [1199,4],
  6. itemsDesktopSmall : [980,3],
  7. itemsTablet: [768,2],
  8. itemsTabletSmall: false,
  9. itemsMobile : [479,1],
  10. singleItem : false,
  11.  
  12. //Basic Speeds
  13. slideSpeed : 200,
  14. paginationSpeed : 800,
  15. rewindSpeed : 1000,
  16.  
  17. //Autoplay
  18. autoPlay : false,
  19. stopOnHover : false,
  20.  
  21. // Navigation
  22. navigation : false,
  23. navigationText : ["prev","next"],
  24. rewindNav : true,
  25. scrollPerPage : false,
  26.  
  27. //Pagination
  28. pagination : true,
  29. paginationNumbers: false,
  30.  
  31. // Responsive
  32. responsive: true,
  33. responsiveRefreshRate : 200,
  34. responsiveBaseWidth: window,
  35.  
  36. // CSS Styles
  37. baseClass : "owl-carousel",
  38. theme : "owl-theme",
  39.  
  40. //Lazy load
  41. lazyLoad : false,
  42. lazyFollow : true,
  43.  
  44. //Auto height
  45. autoHeight : false,
  46.  
  47. //JSON
  48. jsonPath : false,
  49. jsonSuccess : false,
  50.  
  51. //Mouse Events
  52. mouseDrag : true,
  53. touchDrag : true,
  54.  
  55. //Transitions
  56. transitionStyle : false,
  57.  
  58. // Other
  59. addClassActive : false,
  60.  
  61. //Callbacks
  62. beforeInit: false,
  63. afterInit: false,
  64. beforeMove: false,
  65. afterMove: false,
  66. afterAction: false,
  67. startDragging : false
  68.  
  69. })

4. Custom Events

Owl Carousel handles a few basic events. Mainly use them for custom navigation. See Demo


 
  1. "owl.prev" //Go to previous
  2. "owl.next" //Go to next
  3. "owl.play" //Autoplay, also this event accept autoPlay speed as second parameter
  4. "owl.stop" //Stop
  5. "owl.goTo" //goTo provided item
  6. "owl.jumpTo" //jumpTo provided item. Without slide animation.

5. Owl Data methods

To use Owl Carousel $.data use delegate function.


 
  1.  
  2. //Initialize Plugin
  3. $(".owl-carousel").owlCarousel()
  4.  
  5. //get carousel instance data and store it in variable owl
  6. var owl = $(".owl-carousel").data('owlCarousel');
  7.  
  8. //Public methods
  9. owl.next() // Go to next slide
  10. owl.prev() // Go to previous slide
  11. owl.goTo(x) // Go to x slide
  12. owl.jumpTo(x) // Go to x slide without slide animation
  13.  
  14. owl.buildControls() // Build Controlls
  15. owl.destroyControls() // Remove Controlls
  16.  
  17. owl.play() // Autoplay
  18. owl.stop() // Autoplay Stop
  19.  








volkan çelik ven web tasarım facebook volkan çelik ven web tasarım twitter volkan çelik ven web tasarım instegram volkan çelik ven web tasarım google+ volkan çelik ven web tasarım youtube

Yandex.Metrica