Comments (4)
issue can be fixed in less:
> img, a > img {
from justified-gallery.
It's not a bad idea to have the link only around the image. In this way the caption can contain links. I need to verify that the lightboxes work well in those cases. Thank you.
from justified-gallery.
Hi,
I also tried this case.
I realized that in this case the margins added to the img are wrong.
If you remove these it fix the issue.
In fact, we need to remove those margins only if img has one or more parents.
In my case, i fixed it adding a class to the item div ...
<div class="image-wall">
<div class="item">
<a href="#">
<img src="..." />
</a>
</div>
<div class="item">
<img src="..." />
</div>
</div>
And testing it in "displayEntry" function :
var $image = $entry.find('img');
$image.css('width', imgWidth);
$image.css('height', imgHeight);
if ($image.parent().hasClass('item')) {
$image.css('margin-left', -imgWidth / 2);
$image.css('margin-top', -imgHeight / 2);
}
$entry.width(imgWidth);
$entry.height(rowHeight);
$entry.css('top', y);
$entry.css('left', x);
In my case, it works for both version : with and without link. I don't know if it works with the others plugin options.
Maybe there is an easier way to count the number of parents and define if margins have to be applied.
Hope this helps,
from justified-gallery.
Thanks for the help. It will be available in the 3.5. If you want to try this feature before the official release, just use the version in the master branch.
For @lpichoud: I added the 'jg-entry' automatically to each entry to do something similar to your solution.
Thank you for your suggestions.
from justified-gallery.
Related Issues (20)
- Any Event which triggers after rendering of all the images in case of multiple sections ? HOT 3
- Create a vue component HOT 1
- JG blocks scrollTop()? HOT 1
- How can ı resize thumbnaıl with justifygallery
- plugin not working for fix width height container !
- Is it posibble to dynamically change the row height on page resize? HOT 1
- Borders and paddings for images HOT 29
- How to use in Angular 2+
- Error handling
- Lazy loading images HOT 1
- WebP support HOT 3
- Grammar: "Justified Gallery is a JavaScript library that allows you to create an high quality justified gallery of images."
- dist/css/justifiedGallery.min.css is not minified
- Lazyloaded images are not rendered on Firefox
- sizeRangeSuffixes doesn't work if the preview is embedded using base64 encoding
- Justify first instead of last row when odd number of images HOT 1
- Separate row height for smartphone/mobile devices HOT 4
- Many pictures are loaded but not shown.
- Multiple containers and jumping scroll position
- Is it possible to set breakpoints for different rowHeights? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from justified-gallery.