Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

just-carousel

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-carousel - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

31

index.js

@@ -63,2 +63,3 @@ /* global module, window, document */

this.slides = this.inner.children;
this.slidesLength = this.slides.length;
this.isMoving = false;

@@ -114,2 +115,4 @@ this.collectingSpeedTimeout = 0;

slideTo: function (idx, needQuick) {
checkForUpdate.call(this);
this.isMoving = false;

@@ -153,2 +156,6 @@ this.endX = 0;

update: function() {
checkForUpdate.call(this);
},
destroy: function () {

@@ -197,8 +204,12 @@ this.root.removeEventListener('touchstart', this._onTouchStart, false);

for (var i = 0; i < this.slides.length; i++) {
this.slides[i].style.height = '100%';
this.slides[i].style.width = 100 / this.slides.length + '%';
this.slides[i].style.float = 'left';
applyStylesToSlide.call(this, this.slides[i]);
}
}
function applyStylesToSlide(slide) {
slide.style.height = '100%';
slide.style.width = 100 / this.slides.length + '%';
slide.style.float = 'left';
}
function addEvents() {

@@ -436,2 +447,16 @@ this.root.addEventListener('touchstart', this._onTouchStart, false);

function checkForUpdate() {
if (this.slidesLength === this.slides.length) {
return;
}
this.slidesLength = this.slides.length;
this.inner.style.width = 100 * this.slides.length + '%';
for (var i = 0; i < this.slidesLength; i++) {
applyStylesToSlide.call(this, this.slides[i]);
}
}
function nope() {}

@@ -438,0 +463,0 @@

2

package.json
{
"name": "just-carousel",
"version": "0.2.0",
"version": "0.3.0",
"description": "Just an 1-item-on-screen carousel that works naturally like an iOS/android desktops and nothing else.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -90,2 +90,6 @@ # just-carousel

### update()
You can try to call it if something looks strange. it will recalculate some dimensions and reapply styles for slides.
### destroy()

@@ -92,0 +96,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc