mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
Added flag to turn off image featherlight
This commit is contained in:
parent
bed0a6c0d0
commit
3ea5bca755
2 changed files with 15 additions and 2 deletions
|
@ -663,3 +663,11 @@ Add a HTTP `classes` parameter to the link image to add CSS classes. `shadow`and
|
||||||
![stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg?classes=border,shadow)
|
![stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg?classes=border,shadow)
|
||||||
```
|
```
|
||||||
![stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg?width=40pc&classes=border,shadow)
|
![stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg?width=40pc&classes=border,shadow)
|
||||||
|
|
||||||
|
### Lightbox
|
||||||
|
|
||||||
|
Add a HTTP `featherlight` parameter to the link image to disable lightbox. By default lightbox is enabled using the featherlight.js plugin. You can disable this by defining `featherlight` to `false`.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
![Minion](https://octodex.github.com/images/minion.png?featherlight=false)
|
||||||
|
```
|
||||||
|
|
|
@ -21,8 +21,13 @@ var images = $("div#body-inner img").not(".inline");
|
||||||
// Wrap image inside a featherlight (to get a full size view in a popup)
|
// Wrap image inside a featherlight (to get a full size view in a popup)
|
||||||
images.wrap(function(){
|
images.wrap(function(){
|
||||||
var image =$(this);
|
var image =$(this);
|
||||||
if (!image.parent("a").length) {
|
var o = getUrlParameter(image[0].src);
|
||||||
return "<a href='" + image[0].src + "' data-featherlight='image'></a>";
|
var f = o['featherlight'];
|
||||||
|
// IF featherlight is false, do not use feather light
|
||||||
|
if (f != 'false') {
|
||||||
|
if (!image.parent("a").length) {
|
||||||
|
return "<a href='" + image[0].src + "' data-featherlight='image'></a>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue