-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathdev-plugin-api.html
More file actions
160 lines (148 loc) · 5.88 KB
/
dev-plugin-api.html
File metadata and controls
160 lines (148 loc) · 5.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html lang="en">
<head>
<!-- head -->
<meta charset="utf-8">
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Owl Carousel Documentation">
<meta name="author" content="David Deutsch">
<title>
Plugin API | Owl Carousel | 2.3.4
</title>
<!-- Stylesheets -->
<link href='https://fonts.googleapis.com/css?family=Lato:300,400,700,400italic,300italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../assets/css/docs.theme.min.css">
<!-- Owl Stylesheets -->
<link rel="stylesheet" href="../assets/owlcarousel/assets/owl.carousel.min.css">
<link rel="stylesheet" href="../assets/owlcarousel/assets/owl.theme.default.min.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="../assets/ico/favicon.png">
<link rel="shortcut icon" href="favicon.ico">
<!-- Yeah i know js should not be in header. Its required for demos.-->
<!-- javascript -->
<script src="../assets/vendors/jquery.min.js"></script>
<script src="../assets/owlcarousel/owl.carousel.js"></script>
</head>
<body>
<!-- header -->
<header class="header">
<div class="row">
<div class="large-12 columns">
<div class="brand left">
<h3>
<a href="/OwlCarousel2/">owl.carousel.js</a>
</h3>
</div>
<a id="toggle-nav" class="right">
<span></span> <span></span> <span></span>
</a>
<div class="nav-bar">
<ul class="clearfix">
<li> <a href="/OwlCarousel2/index.html">Home</a> </li>
<li> <a href="/OwlCarousel2/demos/demos.html">Demos</a> </li>
<li class="active">
<a href="/OwlCarousel2/docs/started-welcome.html">Docs</a>
</li>
<li>
<a href="https://github.com/OwlCarousel2/OwlCarousel2/archive/2.3.4.zip">Download</a>
<span class="download"></span>
</li>
</ul>
</div>
</div>
</div>
</header>
<!-- title -->
<section class="title">
<div class="row">
<div class="large-12 columns">
<h1>Development</h1>
</div>
</div>
</section>
<div id="docs">
<div class="row">
<div class="small-12 medium-3 large-3 columns">
<ul class="side-nav">
<li class="side-nav-head">Getting Started</li>
<li> <a href="started-welcome.html">Welcome</a> </li>
<li> <a href="started-installation.html">Installation</a> </li>
<li> <a href="started-faq.html">FAQ</a> </li>
</ul>
<ul class="side-nav">
<li class="side-nav-head">API</li>
<li> <a href="api-options.html">Options</a> </li>
<li> <a href="api-classes.html">Classes</a> </li>
<li> <a href="api-events.html">Events</a> </li>
</ul>
<ul class="side-nav">
<li class="side-nav-head">Development</li>
<li> <a href="dev-buildin-plugins.html">Built-in Plugins</a> </li>
<li> <a href="dev-plugin-api.html">Plugin API</a> </li>
<li> <a href="dev-styles.html">Sass Styles</a> </li>
<li> <a href="dev-external.html">External Libs</a> </li>
</ul>
<ul class="side-nav">
<li class="side-nav-head">Support</li>
<li> <a href="support-contributing.html">Contributing</a> </li>
<li> <a href="support-changelog.html">Changelog</a> </li>
<li> <a href="support-contact.html">Contact</a> </li>
</ul>
</div>
<div class="small-12 medium-9 large-9 columns">
<article class="docs-content">
<h2 id="plugin-api">Plugin API</h2>
<blockquote>
<p>Plugin API allows you to extend carousel object constructor and use internal functions and variables. Use callback events to communicate between host and plugin.</p>
</blockquote>
<p>Plugin scaffolding:</p>
<pre><code>/**
* Plugin Name
* @since 2.0.0
*/
;(function ( $, window, document, undefined ) {
PluginName = function(scope){
this.owl = scope;
this.owl._options = $.extend({}, PluginName.Defaults, this.owl.options);
//link callback events with owl carousel here
}
PluginName.Defaults = {
optionName: 'value',
optionName2: 'value'
}
//methods:
PluginName.prototype.method = function(){
}
//destroy:
AutoHeight.prototype.destroy = function(){
//events here
};
$.fn.owlCarousel.Constructor.Plugins['pluginName'] = PluginName;
})( window.Zepto || window.jQuery, window, document );</code></pre>
</article>
</div>
</div>
</div>
<!-- footer -->
<footer class="footer">
<div class="row">
<div class="large-12 columns">
<h5>
<a href="/OwlCarousel2/docs/support-contact.html">David Deutsch</a>
<a id="custom-tweet-button" href="https://twitter.com/share?url=https://github.com/OwlCarousel2/OwlCarousel2&text=Owl Carousel - This is so awesome! " target="_blank"></a>
</h5>
</div>
</div>
</footer>
<!-- vendors -->
<script src="../assets/vendors/highlight.js"></script>
<script src="../assets/js/app.js"></script>
</body>
</html>