Javascript 在Framer.js中打印滚动位置
我正在Framer.js中创建原型。我有一个滚动组件和滚动内容,我试图打印内容的当前x或滚动x位置。因此,如果我向右滚动500px,代码将打印500Javascript 在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
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演示: