Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Framer.js中打印滚动位置_Javascript_Coffeescript_Prototype_Framerjs - Fatal编程技术网

Javascript 在Framer.js中打印滚动位置

Javascript 在Framer.js中打印滚动位置,javascript,coffeescript,prototype,framerjs,Javascript,Coffeescript,Prototype,Framerjs,我正在Framer.js中创建原型。我有一个滚动组件和滚动内容,我试图打印内容的当前x或滚动x位置。因此,如果我向右滚动500px,代码将打印500 Bg = new BackgroundLayer backgroundColor: 'FFF' scroll = new ScrollComponent width: 750 height: 1334 scrollVertical: false layerA = new Layer width: 75

我正在Framer.js中创建原型。我有一个滚动组件和滚动内容,我试图打印内容的当前x或滚动x位置。因此,如果我向右滚动500px,代码将打印500

Bg = new BackgroundLayer
backgroundColor: 'FFF'

scroll = new ScrollComponent 
    width: 750
    height: 1334
    scrollVertical: false

layerA = new Layer 
        width: 750 * 5
        height: 1334 
        superLayer: scroll.content

layerA.style.background = "-webkit-linear-gradient(45deg, #2AF 0%, #F00 100%)"

# get current x value of scroll content
print layerA.scrollX
成帧器演示:

代码笔演示:


提前感谢您,

您可以通过添加事件侦听器打印当前scrollX值:

scroll.onScroll ->
    print scroll.scrollX
有关活动的更多信息:


更新的Framer演示:

您可以通过添加事件侦听器打印当前的scrollX值:

scroll.onScroll ->
    print scroll.scrollX
有关活动的更多信息:

更新的Framer演示: