Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/rahmanda/prasmananjs
- Owner: rahmanda
- License: mit
- Created: 2016-01-31T07:10:40.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T12:51:24.000Z (about 2 years ago)
- Last Synced: 2024-10-11T08:16:51.713Z (2 months ago)
- Topics: carousel, hammerjs, javascript, slider
- Language: JavaScript
- Homepage: http://rahmanda.github.io/prasmananjs/
- Size: 940 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.