flickity icon indicating copy to clipboard operation
flickity copied to clipboard

.flickity-viewport height: 0px

Open rbellini opened this issue 10 years ago • 15 comments

HI,

After loading the images the .flickity-viewport get height: 0px. Why is that?

http://codepen.io/0rf30/pen/WwKEPX

rbellini avatar Apr 22 '16 21:04 rbellini

Use setGallerySize: false

Use setGallerySize: false if you prefer to size the carousel with CSS, rather than using the size of cells.

See demo http://codepen.io/desandro/pen/8742dd3cd74b51a08a23b26e2f775f6a

desandro avatar Apr 23 '16 01:04 desandro

Hey Desandro! First I'd like to thank you for your help. The problem is this issue remains when I tried to edit my original site: http://prometalvisual.com.br/tmp/ (Top menu Produtos > Banners > Etc, etc..). The images still not showing in this case.

rbellini avatar Apr 26 '16 22:04 rbellini

Looks like your cells have no inherent size. You could set:

.gallery-cell {
  height: 100%;
  width: 100%;
}

desandro avatar Apr 27 '16 20:04 desandro

Amazing! Thank you a lot Desandro! \o/

rbellini avatar Apr 27 '16 20:04 rbellini

Hi Desandro! There are two current errors I am not being able to fix. First is the fact that the images from one carousel are mixing with the next (from line 119 on from script.js file). This part of the code is somehow failing to empty the current set. And second and last is a way to start the carousel from index 0. I did try to add initialIndex: 0 on Flickity object and it doesn't seems to be working (line 95 from same source code as before). Current url : http://prometalvisual.com.br/ Thank you a lot!

rbellini avatar Apr 28 '16 20:04 rbellini

Sorry, but I won't be able to debug these issues. I'll leave that up to you!

desandro avatar Apr 28 '16 21:04 desandro

Dear @desandro , I have tried to use setGallerySize: false but our tab only show list items in the first tab, don't show for the rest. Can you help me resolve this problem?

huykon avatar Aug 05 '17 07:08 huykon

You can also use: ImagesLoaded: true. That is exactly for the problem you are trying to solve.

The documentation says:

Unloaded images have no size, which can throw off cell positions. To fix this, the imagesLoaded option re-positions cells once their images have loaded.

eveevans avatar Mar 06 '18 01:03 eveevans

@eveevans You sir, are a lifesaver! Thank you for your solution!

egrechko avatar Jul 06 '18 23:07 egrechko

flikity not work when parent display property set to flex

i tackle this issues by setting parent display : block

coder618 avatar Nov 04 '18 06:11 coder618

@coder618 Thank you, that solved my problem!

berlindave avatar Dec 30 '18 15:12 berlindave

flikity not work when parent display property set to flex

i tackle this issues by setting parent display : block

Thank you @coder618! This also solved my problem!

misterjtc avatar Apr 24 '19 14:04 misterjtc

Thanks @coder618. That fixed it for me as well. This sounds like an issue to me.

janzenz avatar Apr 28 '19 11:04 janzenz

I'm late to the party but using the resize option for me helped too.

The problem: I was not loading flickity on intial page load. I had the set display to be none for the initial load. So the height was always 0 when I tried to unhide it. The solution: I was initializing the flickity to be an object using JavaScript, and had to call myFlickityObject.resize() after unhiding it.

Example: https://codepen.io/desandro/pen/gpmLYG

Tagaca19e avatar Sep 15 '22 16:09 Tagaca19e

@Tagaca19e That fixed it for me. Thank you!

famapohl avatar Oct 09 '23 11:10 famapohl