|
@@ -15,6 +15,8 @@
|
|
|
* */
|
|
|
|
|
|
const SlideResize = (function() {
|
|
|
+ // 水平拖动条的宽度
|
|
|
+ const resizeWidth = 10;
|
|
|
//函数防抖
|
|
|
let timer = null;
|
|
|
function deBounce(fn, wait) {
|
|
@@ -26,14 +28,13 @@ const SlideResize = (function() {
|
|
|
//设置水平拖动条的宽度
|
|
|
//@param {Object dom}resize滚动条
|
|
|
function setResizeWidth (resize) {
|
|
|
- const fixedWidth = 10;
|
|
|
//滚动条节点 及 同层非滚动条节点的索引
|
|
|
let bros = resize.parent().children();
|
|
|
let index = bros.index(resize),
|
|
|
otherIndex = index ? 0 : 1;
|
|
|
const other = resize.parent().children(`:eq(${otherIndex})`);
|
|
|
let resizeParentWidth = resize.parent().width();
|
|
|
- let resizeDecimalWidth = fixedWidth / resizeParentWidth,
|
|
|
+ let resizeDecimalWidth = resizeWidth / resizeParentWidth,
|
|
|
otherDecimalWidth = 1 - resizeDecimalWidth;
|
|
|
let resizePercentWidth = resizeDecimalWidth * 100 + '%',
|
|
|
otherPercentWidth = otherDecimalWidth * 100 + '%';
|
|
@@ -259,5 +260,13 @@ const SlideResize = (function() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return {setResizeWidth, horizontalSlide, loadHorizonWidth, verticalSlide, loadVerticalHeight, loadMultiVerticalHeight}
|
|
|
+ return {
|
|
|
+ resizeWidth,
|
|
|
+ setResizeWidth,
|
|
|
+ horizontalSlide,
|
|
|
+ loadHorizonWidth,
|
|
|
+ verticalSlide,
|
|
|
+ loadVerticalHeight,
|
|
|
+ loadMultiVerticalHeight
|
|
|
+ }
|
|
|
})();
|