Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inputs 模組說明 Part 2 #18

Open
hinablue opened this issue Jun 10, 2014 · 0 comments
Open

Inputs 模組說明 Part 2 #18

hinablue opened this issue Jun 10, 2014 · 0 comments

Comments

@hinablue
Copy link
Owner

#17 接續著講與滑鼠有關的 MouseSyncScrollSync

MouseSync

顧名思義,就是跟滑鼠控制相關的同步事件模組,預設值有以下項目,

MouseSync.DEFAULT_OPTIONS = {
    direction: undefined, // 方向
    rails: false, // 指定單一方向移動
    scale: 1, // 滑鼠軌跡放大倍率
    propogate: true // 在文件中加入 mouseleave 事件監聽
};

常數

這兩個常數是給 direction 所使用的,

  • MouseSync.DIRECTION_X
  • MouseSync.DIRECTION_Y

方法

  • getOptions 取得設定值
  • setOptions 設定設定值

事件

  • start
  • update
  • end

ScrollSync

關於捲軸的同步事件模組,實際上他也會監聽滑鼠的滾輪事件,預設值有,

ScrollSync.DEFAULT_OPTIONS = {
    direction: undefined, // 方向
    minimumEndSpeed: Infinity, // 捲軸移動結束時的移動速度
    rails: false, // 指定單一方向移動
    scale: 1, // 移動軌跡放大倍率
    stallTime: 50, // 結束移動後多久(單位 ms)觸發 end 事件
    lineHeight: 40 // 捲動行高
};

常數

這兩個常數是給 direction 所使用的,

  • ScrollSync.DIRECTION_X
  • ScrollSync.DIRECTION_Y

方法

  • getOptions 取得設定值
  • setOptions 設定設定值

事件

  • start
  • update
  • end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant