Closed nunocgtt closed 7 years ago
... hello?
I'm having some troubles with this library as well, it does strange behavior when dynamically adding photos to it. Not only on the CSS side but as well it affects the end results with duplication.. Seems the contributors are not maintaining it anymore!
Sorry for the late reply. It was not in the original scope to handle dynamic photos, the current solution for this is to add the new options to the select
object and call resync on the picker.
It would be great if you could provide a jsfiddle of any issues you are seeing. Thanks.
The resync was already being done. However the pictures intermitently appear misaligned to the right. Seems a js issue as the html is good clean and consistent.
I got this working, by calling imagepicker() again once I've appended items, and also waiting for imagesLoaded (using desandro's imagesLoaded plugin) and then scrolling to the bottom of the div when they've loaded.
$('#profilephotopicker').imagesLoaded(function(){
$('#profilephotos').scrollTop($('#profilephotos')[0].scrollHeight);
});
Edit: actually that scrolls to the bottom, if you want it to stay scrolled in the middle you can save the scrollHeight before appending the items, and then scroll to that height after they've appended, minus an offset.
From your original pic, that looks a browser css issue where floating items are not properly placed.
Will close this for now but would love to hear how you solved this and if you have any generic solutions.
Hello,
For starters, great plugin. I have a situation where I'm using bootstrap and your plugin to show a bunch of photos. I have the ability to upload a new photo to that album that is refreshed via ajax.
The problem I have is intermittent (doesn't always happen), but sometimes the pictures are misplaced in the grid (i have a 4xN grid of photos) meaning sometimes a new row will add the first picture in slot no. 2.
As you can see in the image, the second row starts off by 1 picture. Row 3 is ok as well. I've checked my css classes and nothing unusual is there. The list is
Thank you for your time.