mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-23 06:55:43 -06:00
Gallery fixes.
- Fixed having multiple galleries in the same page with the same ID, which would cause the galleries after the first one not behaving correctly. - Make sure that all images have finished loading before calling Packery, fixing some image overlapping problems.
This commit is contained in:
parent
3c0d54c41d
commit
83eae55276
1 changed files with 2 additions and 3 deletions
|
@ -1,12 +1,11 @@
|
||||||
{{ $time := now.UnixNano }}
|
{{ $id := delimit (slice "gallery" .Ordinal) "-" }}
|
||||||
{{ $id := delimit (slice "gallery" .Ordinal $time) "-" }}
|
|
||||||
|
|
||||||
<div id="{{ $id }}">
|
<div id="{{ $id }}">
|
||||||
{{ .Inner }}
|
{{ .Inner }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(window).on("load", function () {
|
||||||
$('#{{ $id }}').packery({
|
$('#{{ $id }}').packery({
|
||||||
percentPosition: true,
|
percentPosition: true,
|
||||||
gutter: 5,
|
gutter: 5,
|
||||||
|
|
Loading…
Reference in a new issue