Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rahmanda/prasmananjs

Alternative for infinite slider that plays nicely with mobile.
https://github.com/rahmanda/prasmananjs

carousel hammerjs javascript slider

Last synced: about 1 month ago
JSON representation

Alternative for infinite slider that plays nicely with mobile.

Awesome Lists containing this project

README

        

# Prasmananjs

Prasmananjs is an alternative for infinite slider that plays nicely with mobile (via HammerJS). It is made to be highly adjustable. No need to add another library/plugin if you only want to add it to your desktop web.

## How to use
Simply download this repository to your local directory. Then, add the javascript before the closing body tag like this:

```html

```

Add css on head section like this (optional):

```html

```

Add these code to your html and javascript:

```html



  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.




  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.




  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.





```

```javascript
config = {
container: document.getElementsByClassName('container')[0],
cardMargin: 20,
cardWidth: 0.75,
card: document.getElementsByClassName('card'),
cards: document.getElementsByClassName('cards')[0],
prevControl: document.getElementsByClassName('control--prev')[0],
nextControl: document.getElementsByClassName('control--next')[0]
};
prasmanan = new Prasmanan(config);
prasmanan.serve();
```

If you want a better support for mobile (like swipe to view next/previous slide), add `enableTouch: true` to options, and add [hammerjs](https://github.com/hammerjs/hammer.js) before `prasmananjs` reference.

## Development
It is still highly under development, so it might change frequently. Below are some checklists that i'm working on.

- [ ] Add AMD support.
- [ ] Add more tests.
- [ ] Add center mode.

If you want to contribute, you are very welcome to send a pull request or an issue on this repository.