From: Chris Oyler Date: Tue, 5 Jan 2016 19:57:27 +0000 (-0800) Subject: maybe solved the right handle overflow issue X-Git-Tag: v6.1.2~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=034c7687e961fa6ecf46f7211acea0aa20b64a3f;p=thirdparty%2Ffoundation%2Ffoundation-sites.git maybe solved the right handle overflow issue --- diff --git a/js/foundation.slider.js b/js/foundation.slider.js index 2a5bc536d..e79ed0e0a 100644 --- a/js/foundation.slider.js +++ b/js/foundation.slider.js @@ -250,31 +250,36 @@ //revised halfOfHandle = ~~(percent(handleDim, elemDim) * 100), idx = this.handles.index($hndl); - // console.log(halfOfHandle); + console.log(halfOfHandle); if(isLeftHndl){ var test = halfOfHandle * pctOfBar; - console.log(test, parseFloat(pctOfBar), percent(handleDim, elemDim)); + // console.log(test, parseFloat(pctOfBar), percent(handleDim, elemDim)); css[lOrT] = movement + '%';// //original // css[lOrT] = (pctOfBar > 0 ? (pctOfBar * 100) : 0) + '%';// dim = percent((this.$handle2.attr('aria-valuenow') - this.$handle.attr('aria-valuenow')), this.options.end) * 100; + var thing = parseFloat(this.$handle2[0].style[lOrT]) - movement + halfOfHandle; + // console.log(thing, movement); // dim = ((this.$handle2.attr('aria-valuenow') - this.$handle.attr('aria-valuenow')) / this.options.end) * 100; - css['min-' + hOrW] = dim + '%'; + css['min-' + hOrW] = thing + '%'; + // css['min-' + hOrW] = dim + '%'; if(cb && typeof cb === 'function'){ cb(); } }else{ var handleLeft = parseFloat(this.$handle[0].style.left); //further revised - console.log('loc before math',location); + var thing = movement - (parseFloat(this.$handle[0].style[lOrT]) || this.options.initialStart) + halfOfHandle; location = (location - ((!isNaN(handleLeft) ? handleLeft : this.options.end - location))); - movement += halfOfHandle; + console.log('test',movement, halfOfHandle, thing); + // movement += halfOfHandle; // revised edition // location = (location < this.options.end ? location : this.options.end) - ((!isNaN(handleLeft) ? handleLeft : this.options.end - location)); // original // location = (location < 100 ? location : 100) - (!isNaN(handleLeft) ? handleLeft : this.options.end - location); // css['min-' + hOrW] = movement - parseFloat(this.$handle.attr('aria-valuenow')) + halfOfHandle /2 + '%'; - css['min-' + hOrW] = location + '%'; + css['min-' + hOrW] = thing + '%'; + // css['min-' + hOrW] = location + '%'; console.log('loc aftermath, lol',location); } }