You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
<h3>Opening/closing causes fixed header to jump</h3>
1144
+
<h3>Opening/closing causes fixed element to jump</h3>
1067
1145
1068
1146
<p>
1069
1147
Simply add <code>compensate-for-scrollbar</code> CSS class to your fixed positioned elements.
@@ -1076,11 +1154,23 @@ <h3>Opening/closing causes fixed header to jump</h3>
1076
1154
</div>
1077
1155
</nav></code></pre>
1078
1156
1157
+
<p>
1158
+
The script measures width of the scrollbar and creates <code>compensate-for-scrollbar</code> CSS class
1159
+
that uses this value for <code>margin-right</code> property.
1160
+
Therefore, if your element has <code>width:100%</code>, you should positon it using <code>left</code> and <code>right</code> properties instead. Example:
1161
+
</p>
1162
+
1163
+
<pre><code>.navbar {
1164
+
position: fixed;
1165
+
top: 0;
1166
+
left: 0;
1167
+
right: 0;
1168
+
}</code></pre>
1079
1169
1080
1170
<h3>How to customize caption</h3>
1081
1171
1082
1172
<p>
1083
-
Example of appending image download link:
1173
+
You can use <code>caption</code> option that accepts a function and is called for each group element. Example of appending image download link:
1084
1174
</p>
1085
1175
1086
1176
<pre><code>$( '[data-fancybox]' ).fancybox({
@@ -1099,6 +1189,21 @@ <h3>How to customize caption</h3>
1099
1189
<ahref="http://codepen.io/fancyapps/pen/ygeYGx?editors=1010" target="_blank">View demo on CodePen</a>
1100
1190
</p>
1101
1191
1192
+
1193
+
<p>
1194
+
Example of using different source for caption:
1195
+
</p>
1196
+
1197
+
<pre><code>$( '[data-fancybox]' ).fancybox({
1198
+
caption : function( instance, item ) {
1199
+
return $(this).find('figcaption').html();
1200
+
}
1201
+
});</code></pre>
1202
+
<pclass="demo">
1203
+
<ahref="https://codepen.io/fancyapps/pen/bgEQXo?editors=1010" target="_blank">View demo on CodePen</a>
1204
+
</p>
1205
+
1206
+
1102
1207
<h3>How to create custom button in the toolbar</h3>
0 commit comments