viewport-checker
viewport-checker copied to clipboard
Fixed dataset 'true' & 'false' conversions to boolean values in check()
Because the data values inside html elements are strings (for example data-vp-repeat="true"
), boolean values won't work inside check() function since both "true"
and "false"
are both true statements in if (objOptions.invertBottomOffset){}
. So I checked what was the value in $obj.dataset[dataKey]
and if it was "true"
or "false"
I converted them to boolean values with the helper method I created.
I also made the demo website take the full screen because its easier to work with.