
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
just-carousel
Advanced tools
Just an 1-item-on-screen carousel that works naturally like an iOS/android desktops and nothing else.
Just an 1-item-on-screen carousel that works naturally like an iOS/android desktops and nothing else.
transform3d
).Thus, this carousel will suit you, if you just need a lightweight, simple, 1-item-on-screen touch-carousel.
Need something more? Try Swiper.
$ npm install -S just-carousel
or oldschool method:
<script src="just-carousel.js"></script>
<div class="carousel">
<ul> <!-- Root element must contain ul > li structure -->
<li>1</li> <!-- li may contain anything -->
<li>2</li>
<li>3</li>
</ul>
</div>
const justCarousel = require('just-carousel'); // ← if you use build system
const carousel = new JustCarousel({
root: document.querySelector('.carousel'),
onChangePos: function (data) {
console.log(data); // {prevSlide, currentSlide}
}
});
Type: DOM Node
Required
A root element of carousel.
Starting element.
Type: number
Animation duration (milliseconds, default is 250)
Type: function
Animation timing function
/**
* Default function is ease-out
* @param {number} t — timing fraction (from 0 to 1)
* @returns {number} — animation fraction
*/
function (t) {
return t * (2 - t);
}
Type: function
Calls when the end of the animation. Accepts only object argument
contains fields: prevSlide
and currentSlide
.
Calls whenever any animation is started, including calling slideTo and user touch moving.
Useful to optimize FPS (For example, you can stop video playing inside of slide when carousel animating.).
Callback takes object with field currentSlide
contains index.
Calls whenever any animation is stopped. Callback takes object with fields currentSlide
and prevSlide
contain indexes.
You can try to call it if something looks strange. it will recalculate some dimensions and reapply styles for slides.
MIT © f0rmat1k
Special thanks to air-breathing.
FAQs
Just an 1-item-on-screen carousel that works naturally like an iOS/android desktops and nothing else.
The npm package just-carousel receives a total of 0 weekly downloads. As such, just-carousel popularity was classified as not popular.
We found that just-carousel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.