Giter Club home page Giter Club logo

morphing-carousel-ionic's Introduction

Morph Carousel - Ionic Plugin

Morph carousel is an ionic plugin that allows you to add carousel to your application.

Plugin has two pre-installed themes

Black

alt tag

White

alt tag

Current version 1.1

Tested for ionic 1.0

Demo view App ID f0c502da

Usage

  1. Add data to your controller
$scope.items = [
  { number: 1 },
  { number: 2 },
  { number: 3 },
  { number: 4 },
  { number: 5 },
  { number: 6 },
  { number: 7 },
  { number: 8 },
  { number: 9 },
  { number: 10 },
  { number: 11 },
  { number: 12 },
  { number: 13 },
  { number: 14 },
  { number: 15 }
];
$scope.selectedItem = $scope.items[2];
  1. Add directive
<morph-carousel data-items="items" on-selected="selectedItem" identifier="modal-carousel" show-value="number"></morph-carousel>
  • data-items - array of items
  • on-selected - will contain selected item
  • identifier - (optional) used to identify this morphCarousel with $morphCarousel factory
  • show-value - (optional) if array contain object you need to provide property that contain value that should be shown. If you want to use simple array of numbers (or strings) you can omit this parameter.

Usage in modal

In case you're using carousel in modal you will need to update it after opening modal. Use 'identifier' attribute in order to access relevant carousel.

You can update it by using helper factory $morphCarousel. Just inject it into controller and use update() method.

$scope.openModal = function() {
  $scope.modal.show();
  $morphCarousel.update('modal-carousel');
};

morphing-carousel-ionic's People

Contributors

artemdemo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

morphing-carousel-ionic's Issues

Scroll is very hard on android devices

Hi there,
I am developing an ionic app in which I am using your plugin. On Iphone its working fine but on android the scroll is working too hard.

I tried decreasing the animation speed but still no luck.

Please advice.

How to get this plugin working?

I added the files manually into my project but this plugin is not working. Please suggest me what else i have to do to get this plugin working.

selectedItem not being updated

Hi,

I added a watcher to watch when the carousel slide changes.
$scope.$watch('selectedItem', function(newVal,oldVal){
alert(newVal + ',' + oldVal);
});

However, when I slide the carousel, this function never kicks off and selectedItem remains unchanged.
This function only kicks off once initially when I load the webpage (when my js code initially set
selectedItem = items[2]; )

Is there something that I'm doing wrong? I'm trying to find codes in morphCarousel.js that sets selectedItem when the carousel is slided, but I'm not sure where....

Any help is deeply appreciated!

How can I block the carousel at its end points

Hi there,

I am using this plugin in my ionic app. I want to block the carousel at its end points. Right now I can move from first element to last element by dragging backward but I want to avoid that.

Thanks.

Missing out items having length more than 15

It's working great for items up to 15. But if i increase length of items from 15 it is missing out values.

FYI. I took code from master branch.

Please help as i have a deliverable by day end tomorrow.

Items not selected properly if item width is too small

I am trying to use this carousel to display 30 items in mobile device.
The problem is that I am facing problem in selecting particular item as some times it is not detecting item change. Please help.
Tried same with large screen area & working fine.
demo

items length 7

Hi, very cool, but if items.length = 7 doesn´t seem to get the selectedItem of second and third item

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.