0

{pointerEvents: 'none'} 属于 Surface 的什么位置?

来自 Famo.us 大学的“音色”示例: http ://famo.us/university/ Famous-102/timbre/24/

function _createIcon() {
    var iconSurface = new ImageSurface({
        size: [this.options.iconSize, this.options.iconSize],
        content : this.options.iconUrl,
        pointerEvents : 'none'
    });

并来自: http: //famo.us/university/ Famous-102 /timbre/25/

function _createTitle() {
    var titleSurface = new Surface({
        size: [true, true],
        content: this.options.title,
        properties: {
            color: 'white',
            fontSize: this.options.fontSize + 'px',
            textTransform: 'uppercase',
            pointerEvents : 'none'
        }
    });

根据 Surface 文档: http: //famo.us/docs/0.2.0/core/Surface
属性:是

要在目标 div 上设置的HTML属性字符串字典

“PointerEvent 接口”由 W3C
http://www.w3.org/TR/pointerevents/#pointerevent-interface
定义,因此将其包含在属性对象中似乎是合适的。

但是,如果pointerEvents可以在properties对象的内部和外部使用,那么properties对象有什么真正的意义吗?Surface 对象最终是否被展平?

或者 Surface 和 ImageSurface 处理属性的方式不同?我无法从文档中看出。

4

2 回答 2

1

恭喜!您在 famo.us 大学中发现了一个错误!

我访问了您的链接并检查了旨在设置其指针事件值的图标。而不是“none”,而是“auto”(来自 famo.us 大学中使用的基础着名表面 CSS 类)

在教程的第 25 页中pointer-events是在正确的位置(在属性对象内)

不是有效 html 属性的选项会被浏览器简单地忽略。properties 对象中的所有内容都应用于 Surface 的 style 属性

ImageSurfacean和 normal之间的唯一区别Surface是它ImageSurface是 a<img>而不是 a<div>

它还有一个预制src属性来存储图像的 url,Surface你需要在content属性的行上写一些东西。

于 2014-05-26T10:03:11.150 回答
0

来自 famo.us 这里的舒。

感谢您指出了这一点。克雷格,你是对的。这已得到修复。

于 2014-05-28T17:19:16.510 回答