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

carrossel

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carrossel - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

package.json
{
"name": "carrossel",
"version": "1.0.0",
"version": "1.1.0",
"description": "An agnostic framework carousel very easy to implement",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -22,4 +22,6 @@ let carouselElements

updateButtons()
arrowLeftElement.addEventListener('click', scrollToLeft)
arrowRightElement.addEventListener('click', scrollToRight)
carouselContainer.addEventListener('scroll', updateButtons)
}

@@ -43,2 +45,12 @@

function updateButtons() {
arrowLeftElement.disabled = false
arrowRightElement.disabled = false
if (!carouselContainer.scrollLeft) {
arrowLeftElement.disabled = true
} else if (scrolledDistance() === carouselContainer.scrollWidth) {
arrowRightElement.disabled = true
}
}
function advancePointer() {

@@ -64,2 +76,6 @@ let index = carouselElements.indexOf(currentElement)

function scrolledDistance() {
return carouselContainer.clientWidth + carouselContainer.scrollLeft
}
function getWidthPlusPaddingAndMargin(element) {

@@ -66,0 +82,0 @@ return parseInt(window.getComputedStyle(element).width) +

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