Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit e46bf80

Browse files
committed
Update docs to include recent changes
1 parent 8acf7b7 commit e46bf80

File tree

1 file changed

+40
-13
lines changed

1 file changed

+40
-13
lines changed

docs/index.html

+40-13
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
77
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
88

9-
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700|Open+Sans:400,700" rel="stylesheet">
9+
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700|Open+Sans:400,700" rel="stylesheet" />
1010

1111
<script src="//code.jquery.com/jquery-3.1.1.min.js"></script>
1212

@@ -263,7 +263,9 @@ <h1><a href="http://fancyapps.com/fancybox/3/">fancyBox3</a> Documentation</h1>
263263

264264
<ul>
265265
<li><a href="http://fancyapps.com/fancybox/3/">Homepage</a></li>
266-
<li><a href="https://github.com/fancyapps/fancyBox">Github</a></li>
266+
<li><a href="http://fancyapps.com/fancybox/3/docs/">Documentation</a></li>
267+
<li><a href="http://fancyapps.com/store/">Store</a></li>
268+
<li><a href="https://github.com/fancyapps/fancybox">Github</a></li>
267269
</ul>
268270
</div>
269271
</header>
@@ -806,7 +808,8 @@ <h2 id="options">Options</h2>
806808
// Error message template
807809
errorTpl : '&lt;div class=&quot;fancybox-error&quot;&gt;&lt;p&gt;The requested content cannot be loaded. &lt;br /&gt; Please try again later.&lt;p&gt;&lt;/div&gt;',
808810

809-
closeTpl : '&lt;button data-fancybox-close class=&quot;fancybox-close-small&quot;&gt;×&lt;/button&gt;',
811+
// This will be appended to html content, if &quot;smallBtn&quot; option is not set to false
812+
closeTpl : '&lt;button data-fancybox-close class=&quot;fancybox-close-small&quot;&gt;&lt;/button&gt;',
810813

811814
// Container is injected into this element
812815
parentEl : 'body',
@@ -823,7 +826,7 @@ <h2 id="options">Options</h2>
823826
// Close when clicked outside of the content
824827
closeClickOutside : true,
825828

826-
// Callbacks
829+
// Callbacks; See Documentation/API/Events for description and samples
827830
beforeLoad : $.noop,
828831
afterLoad : $.noop,
829832
beforeMove : $.noop,
@@ -835,7 +838,6 @@ <h2 id="options">Options</h2>
835838
afterClose : $.noop,
836839
onActivate : $.noop,
837840
onDeactivate : $.noop
838-
839841
}
840842
</pre>
841843

@@ -1049,7 +1051,6 @@ <h3 id="events">Events</h3>
10491051

10501052
<p>
10511053
fancyBox fires several events.
1052-
10531054
</p>
10541055

10551056
<pre><code>beforeLoad : Before the content of a slide is being loaded
@@ -1094,8 +1095,13 @@ <h3 id="events">Events</h3>
10941095
&lt;/script&gt;</code></pre>
10951096

10961097
<p>
1097-
It is also possible to attach an event handler for all instances.
1098+
Each callback receives two parameters - current fancyBox instance and current gallery object, if exists.
1099+
</p>
1100+
1101+
<p>
1102+
It is also possible to attach event handler for all instances.
10981103
To prevent interfering with other scripts, these events have been namespaced to <code>.fb</code>.
1104+
These handlers receive 3 parameters - event, current fancyBox instance and current gallery object.
10991105
</p>
11001106
<p>
11011107
Here is an example of binding to the <code>onComplete</code> event:
@@ -1106,6 +1112,17 @@ <h3 id="events">Events</h3>
11061112
});</code></pre>
11071113

11081114

1115+
<p>
1116+
If you wish to prevent closing of the modal, for example, if form is not validating, you can use <code>beforeClose</code>
1117+
callback. Simply return <code>false</code>:
1118+
</p>
1119+
1120+
<pre><code>beforeClose : function( instance, current, e ) {
1121+
if ( $('#my-field').val() == '' ) {
1122+
return false;
1123+
}
1124+
}
1125+
</code></pre>
11091126

11101127
<h2 id="modules">Modules</h2>
11111128

@@ -1129,7 +1146,11 @@ <h2 id="modules">Modules</h2>
11291146
thumbs : {
11301147
showOnStart : false, // Display thumbnails on opening
11311148
hideOnClosing : true // Hide thumbnail grid when closing animation starts
1132-
}</code></pre>
1149+
},
1150+
fullScreen : {
1151+
requestOnStart : false // Request fullscreen mode on opening
1152+
},
1153+
hash : false // Hash value</code></pre>
11331154

11341155
<p>
11351156
Example (show thumbnails on start):
@@ -1172,16 +1193,23 @@ <h2 id="modules">Modules</h2>
11721193
Thumbs.show();
11731194
Thumbs.toggle();
11741195

1175-
FullScreen.isAvailable();
1176-
FullScreen.isActivated();
1177-
FullScreen.launch();
1196+
FullScreen.request( elem );
11781197
FullScreen.exit();
1179-
FullScreen.toggle();
1198+
FullScreen.toggle( elem );
1199+
FullScreen.isFullscreen();
1200+
FullScreen.enabled();
11801201

11811202
SlideShow.start();
11821203
SlideShow.stop();
11831204
SlideShow.toggle();
11841205
</code></pre>
1206+
1207+
<p>
1208+
If you wish to disable hash module, use this snippet (after including JS file):
1209+
</p>
1210+
1211+
<pre><code>$.fancybox.defaults.hash = false;</code></pre>
1212+
11851213
<!--
11861214
11871215
FAQ
@@ -1298,7 +1326,6 @@ <h3>How to reposition thumbnail grid</h3>
12981326
</p>
12991327
</div>
13001328
</footer>
1301-
13021329
<script>
13031330

13041331
/* Sticky nvigation */

0 commit comments

Comments
 (0)