revolunet / angular-carousel

Mobile friendly AngularJS carousel
http://revolunet.github.io/angular-carousel
MIT License
1.55k stars 705 forks source link

Library stopped working with angular 1.3.1 #245

Open BeOleg opened 10 years ago

BeOleg commented 10 years ago

My bower.json:

{
  "name": "blue",
  "version": "0.0.0",
  "dependencies": {
    "angular": "1.3.1",
    "json3": "~3.3.1",
    "es5-shim": "~3.1.0",
    "bootstrap-sass-official": "~3.2.0",
    "angular-sanitize": "1.3.1",
    "angular-animate": "1.3.1",
    "angular-touch": "1.3.1",
    "restangular": "~1.4.0",
    "ui-bootstrap": "~0.11.2",
    "ui-router": "~0.2.11",
    "ng-grid": "~2.0.13",
    "angular-bootstrap": "~0.11.2",
    "angular-carousel": "~0.3.5"
  },
  "devDependencies": {
    "angular-mocks": "1.3.1",
    "angular-scenario": "1.3.1"
  },
  "appPath": "app"
}
        <ul rn-carousel class="image">
            <li ng-repeat="image in email.value.files">
                <div class="layer">{{ image }}</div>
            </li>
        </ul>
        <ul rn-carousel class="image">
            <li>slide #1</li>
            <li>slide #2</li>
            <li>slide #3</li>
        </ul>

the <ul rn-carousel class="image"> shows on the DOM with width and height of 0px.

Any assistance is highly appreciated.

revolunet commented 10 years ago

Hi man, The css slightly changed in carousel 0.3+ (much lighter) did you get the last css from the repo ? https://github.com/revolunet/angular-carousel/blob/master/dist/angular-carousel.css

geekyme commented 10 years ago

I'm getting the same issue. Already updated the bower package but i still get height 0px even thought my images are 480px * 480px large

geekyme commented 10 years ago

Wrote a simple example:

image

This is the result:

image

revolunet commented 10 years ago

any plunker around ?

geekyme commented 10 years ago

http://plnkr.co/edit/jQZmKrKvue090h7VKDf7?p=preview instead

revolunet commented 10 years ago

yep you need to set your ul height in css

geekyme commented 10 years ago

that doesnt make sense... previously i dont have to do that. Also, my images are coming in dynamically and I need to support different screen sizes. I should not be hardcoding the ul height but instead allow the height to stretch according to the image sizes.

revolunet commented 10 years ago

looks like its due to the position:relative on the ul. i'll try to find a solution but if you have some time, PR appreciated :)

geekyme commented 10 years ago

I don't really know the innards of how you wire up the transitions... but anyway when I changed position:absolute below to position: relative, the images appear again. However the transitions between slides broke so you would probably know best about that

angular-carousel.css:14

  ul[rn-carousel] > li {
    color: black;
    -webkit-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: visible;
    vertical-align: top;
    position: absolute;
    left: 0;
    right: 0;
    white-space: normal;
    padding: 0;
    margin: 0;
    list-style-type: none;
    width: 100%;
    height: 100%;
    display: inline-block; }
geekyme commented 9 years ago

is this fixed in the new release? I see you added a new feature.

revolunet commented 9 years ago

nope we need to find a proper solution

olliekav commented 9 years ago

I managed to get around this for now by adding the following to ul[rn-carousel]

ul[rn-carousel] {
height: 100%;
min-height: 100%;
}

That works for me on android/iOS.

iam4x commented 9 years ago

@olliekav Thought the same, didnt worked as expected for me :/

samsface commented 9 years ago

This at least shows you the contents of the carousel again @iam4x :

ul[rn-carousel] {
height: 1000px;
min-height: 100%;
}

My workaround is setting the height with javascript : /

iam4x commented 9 years ago

@samsface It depends on your layout, 1000px would be rly too much for me :)

maharjanmilan commented 9 years ago

Is there a workaround guys? I am still facing this problem :(

samsface commented 9 years ago

I used an angular watch on the height of the elements directly inside the carousel where the watch callback function sets the height of the carousel. I don't like it, but it's the only thing I could think off.

molerat619 commented 8 years ago

any news here?