MCPcopy
hub / github.com/metafizzy/flickity / isPositionApprox

Function isPositionApprox

test/unit/add-remove-cells.js:11–16  ·  view source on GitHub ↗
( value, expected )

Source from the content-addressed store, hash-verified

9
10 // position values can be off by 0.1% or 1px
11 function isPositionApprox( value, expected ) {
12 var isPercent = value.indexOf('%') != -1;
13 value = parseFloat( value );
14 var diff = Math.abs( expected - value );
15 return isPercent ? diff < 0.1 : diff <= 1;
16 }
17
18 var elem = document.querySelector('#add-remove-cells');
19 var flkty = new Flickity( elem );

Callers 2

checkCellElemFunction · 0.70
checkCellPositionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…