Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

修复slider滑屏失效和 设置初始值的bug #355

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shoaly
Copy link

@shoaly shoaly commented Feb 6, 2017

  1. 返回上一次更新, 还是将 触屏事件限制到 containner内部, 否则这个页面无法滑动了
    this.container.on($.touchEvents.move, $.proxy(this.touchMove, this))
    // $(document.body).on($.touchEvents.move, $.proxy(this.touchMove, this)) // move even outside container

  2. 当slider有初始化值, 比如30% 的时候, 我尝试设置weui-slider__track 和 weui-slider__handler 还有weui-slider-box__value, 然后发现bug发生在 : this.left = parseInt(this.container.find('.weui-slider__handler').css('left')), css里面的值是 百分比, left 没有乘以width 导致异常, 修改为:
    var per = parseInt(this.container.find('.weui-slider__handler').css('left') )
    this.left = this.width * per /100;

1. 返回上一次更新, 还是将 触屏事件限制到 containner内部, 否则这个页面无法滑动了
this.container.on($.touchEvents.move, $.proxy(this.touchMove, this))
    // $(document.body).on($.touchEvents.move, $.proxy(this.touchMove, this)) // move even outside container

2. 当slider有初始化值, 比如30% 的时候, 我尝试设置weui-slider__track 和 weui-slider__handler 还有weui-slider-box__value, 然后发现bug发生在 : this.left = parseInt(this.container.find('.weui-slider__handler').css('left')),  css里面的值是 百分比, left 没有乘以width 导致异常, 修改为:
var per = parseInt(this.container.find('.weui-slider__handler').css('left') ) 
this.left = this.width * per /100;
@shoaly shoaly changed the title Update slider.js 修复slider滑屏失效和 设置初始值的bug Feb 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant