famo.us输入表面类型范围最小/最大属性

时间:2014-10-20 20:18:48

标签: famo.us

我正在尝试为类型范围的inputSurface设置min max属性,但它不起作用。生成的输入元素没有最小/最大属性。

我的代码:

  var moveDown = this.options.flyerSheetHeight + this.options.flyerItemHeight + 2;

  var downModifier = new StateModifier({
      transform: Transform.translate(0, moveDown, 0)
    });

    var flyerItemGenSurface = new InputSurface({
      size: [this.options.flyerSheetWidth, 5],
      type: 'range',
      min: 1,
      max: 10,
      properties: {
        zIndex: 1,
      }
    });

    this.mainNode.add(downModifier).add(flyerItemGenSurface);

1 个答案:

答案 0 :(得分:2)

试试这个!

var moveDown = this.options.flyerSheetHeight + this.options.flyerItemHeight + 2;

var downModifier = new StateModifier({
  transform: Transform.translate(0, moveDown, 0)
});

var flyerItemGenSurface = new InputSurface({
  size: [this.options.flyerSheetWidth, 5],
  type: 'range',
  properties: {
    zIndex: 1,
  },
  attributes: {
    min: 1,
    max: 10
  }
});

this.mainNode.add(downModifier).add(flyerItemGenSurface);

编辑:woops