Flickity with images as children of cells and IMG max-width : 100%
When Fickity is with Images as children of slides ( DIV element for example ), and the IMG element max-width is set to 100% ( as is the case with Foundation framework, i guess also with other frameworks ) on Webkit browsers ( occurred on Chrome and iOS Safari ) strange behavior occurs, as the cells that are not visible on the screen have no width. On Firefox there is no problem.
Solution is simple, just set max-width:none , on the IMG elements that are cells of Flickity.
Just wanted to share, as i lost 2 hours today, trying to spot the cause of the problem ( thought it is #27 related at first ) and find a solution.
Thanks for reporting this issue. Even better, could you put together a reduced test case? This will help others who run into the same issue. See Submitting Issues in the contributing guidelines.
Sure no problem, the issue can be seen here : http://cubus-projekt.com/flickity/ . I really think it's a Webkit bug, and not a Flickery issue. just wanted to put it here in case somebody else runs into it, as said this is the default Foundation behavior, and as far as i know Bootstrap also.
Thank you for your example. I've put it in a CodePen: http://codepen.io/desandro/pen/mJrJmg The bug is occurring because the cells are positioned with position: absolute. The cells do not have intrinsic widths, as they would with static/relative positioning.
Another solution is to set a width on cells: .gallery-cell { width: 100% } http://codepen.io/desandro/pen/NqRqax
But with .gallery-cell { width: 100% } you are have only a single image per screen, this is not the desired behavior, as opposed to .gallery-cell .img { max-width: none: }, which preserves the desired behavior, as in here : http://codepen.io/nanov/pen/jPMPpy.
Hi folks, I just submitted a similar issue, hadn't seen this before, not sure if the root cause of my problem is the same, however the issue occurs on any browser, even non webkit based, see below link:
http://bypasswebdevelopment.com/bradleys/
I tried setting max-width to none, but it just won't work...
@danielemanca1983 I'm not sure I see the bug. The gallery looks to take the full width of the window. If you do run into trouble, try producing a reduced test case and submitting a new issue.
@desandro, the gallery itself does take the full width, however it's the slides to have the issue. If you slide the images you will notice that the slides do not occupy the full width. Sorry I don't have a codepen account and am not sure how to produced a reduced test case.