angular-carousel icon indicating copy to clipboard operation
angular-carousel copied to clipboard

Dynamic height problem

Open AviFix opened this issue 9 years ago • 15 comments

Hi,

i ran in to a problem, with dynamic height.

i give the ul the following css:

ul { width: 100%; min-height:150px; max-height:550px; background-color:green; }

but the height is stock on 150px.

example: http://plnkr.co/edit/kefCFYLR8t7qfa4VUc2C?p=preview

Thanks alot

Avi

AviFix avatar Mar 10 '15 16:03 AviFix

I got the same problem with the height

Rakonda avatar Mar 11 '15 10:03 Rakonda

Same problem here. Seems like it used to work in some older version before li tags were position: absolute.

omnibs avatar Mar 12 '15 15:03 omnibs

Yeah, same problem. Any one have an idea?

wesleyfsmith avatar Mar 14 '15 21:03 wesleyfsmith

Try adding a class on active slide (something like ng-class='{ active: $index == myIndexVariable }'); then add CSS ul[rn-carousel] > li.active { position: relative }.

inca avatar Mar 22 '15 13:03 inca

Hi. I was able to get dynamic height working with the following additional styles:

ul[rn-carousel] {
  > li {
    position: relative;
    margin-left: -100%;

    &:first-child {
      margin-left: 0;
    }
  }
}

mariusc23 avatar Mar 24 '15 14:03 mariusc23

Hi Marius @mariusc23 , Are you able to create a super brief plunkr showing how the height auto resizes ? Thank you

tonyawad88 avatar Apr 01 '15 11:04 tonyawad88

Hi @tonyawad88, Here's a plunk. Note how there is no fixed height set. The carousel is as tall as the longest slide.

mariusc23 avatar Apr 01 '15 18:04 mariusc23

Thank you ! that works great !

tonyawad88 avatar Apr 02 '15 16:04 tonyawad88

@mariusc23

tonyawad88 avatar Apr 02 '15 16:04 tonyawad88

@mariusc23 :+1: :smile:

lookfirst avatar Jun 28 '15 23:06 lookfirst

Still there is error. After using @mariusc23 method, the li is slight taller than the image at all time. If you set the li background as black, you can see the image is not filling up the vertical space. There is a black line in the button... How can I make the li / ul element exactly the same size as the image?

hughred22 avatar Oct 02 '15 22:10 hughred22

@hughred22 Try setting display: block on the images.

mariusc23 avatar Oct 03 '15 02:10 mariusc23

@mariusc23 thanks so much for the snippet! (: the patch works well for browsers that support the translate3d. for ie9, margin patch seems not enough.. its ok for the first swipe, the second swipe onwards, the margin-left fallback method that the library use seems to be off.

badoet avatar Oct 05 '15 16:10 badoet

@mariusc23 Thanks!!! works great. as @badoet mentions, this doesn't work on IE9. Does anybody have a fix for IE?

i can't seem to find a solution... thanks!

idan666 avatar Oct 12 '15 09:10 idan666

@mariusc23 works well !, adding "display:block" to the images did the trick on Motorola X (Android 6.0) !, suppose this will work on all android devices , will test it out . Thank you!

vinodhdk avatar May 04 '16 04:05 vinodhdk