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.3.1 to 1.4.0

18

index.js

@@ -20,3 +20,3 @@ let carouselElements

if (carouselContainer.clientWidth > getTotalWidthOfItems()) return
if (carouselContainer.clientWidth > carouselContainer.scrollWidth) return

@@ -69,8 +69,2 @@ updateButtons()

function getTotalWidthOfItems() {
return carouselElements
.map(element => getWidthPlusPaddingAndMargin(element))
.reduce((acc, cur) => acc + cur)
}
function scrolledDistance() {

@@ -81,7 +75,7 @@ return carouselContainer.clientWidth + carouselContainer.scrollLeft

function getWidthPlusPaddingAndMargin(element) {
return parseInt(window.getComputedStyle(element).width) +
parseInt(window.getComputedStyle(element).paddingLeft) +
parseInt(window.getComputedStyle(element).paddingRight) +
parseInt(window.getComputedStyle(element).marginLeft) +
parseInt(window.getComputedStyle(element).marginRight)
return parseFloat(window.getComputedStyle(element).width) +
parseFloat(window.getComputedStyle(element).paddingLeft) +
parseFloat(window.getComputedStyle(element).paddingRight) +
parseFloat(window.getComputedStyle(element).marginLeft) +
parseFloat(window.getComputedStyle(element).marginRight)
}
{
"name": "carrossel",
"version": "1.3.1",
"version": "1.4.0",
"description": "An agnostic framework carousel very easy to implement",

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

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