famo.us

Droppable in Famous.js?

天大地大妈咪最大 提交于 2019-11-30 22:31:32
I am trying to implement a draggable/dropable image in famous.js. That is, if an image is dropped on the correct surface, an event will trigger. On my draggable image, I am listening for the 'touchend' event. No problem here. I also have a touchend event connected to my 'target' surface. The problem is that this touchend event doesn't fire when I release the draggable, only the touchend from the draggable is triggered. My question is: Does Famous.js have a 'droppable' object like in jQuery? If not, how can I detect when an event occurs on top of my target view? My code is pretty much just the

Droppable in Famous.js?

家住魔仙堡 提交于 2019-11-30 17:33:59
问题 I am trying to implement a draggable/dropable image in famous.js. That is, if an image is dropped on the correct surface, an event will trigger. On my draggable image, I am listening for the 'touchend' event. No problem here. I also have a touchend event connected to my 'target' surface. The problem is that this touchend event doesn't fire when I release the draggable, only the touchend from the draggable is triggered. My question is: Does Famous.js have a 'droppable' object like in jQuery?

How to Swipe between surfaces in Famo.us?

独自空忆成欢 提交于 2019-11-29 23:14:33
问题 Using the following Famo.us example code that adds 10 surfaces displayed vertically with 100% width and height, how can I add functionality to swipe between them, similar to how the swiping works on the iOS home screen? define(function(require, exports, module) { var Engine = require("famous/core/Engine"); var Surface = require("famous/core/Surface"); var SequentialLayout = require("famous/views/SequentialLayout"); var mainContext = Engine.createContext(); var sequentialLayout = new

Drag a Famous surface and have it transition back to origin on mouseup?

岁酱吖の 提交于 2019-11-29 14:38:36
问题 I want to drag a Famous surface, and have it return to its original position when I let go of it. I've taken the "Drag" example and modified it, but while the mouseup callback is triggering (I checked with console.log ), the modifier transform is not. Here's the relevant code: var surface = new Surface({ size: [200, 200], content: 'drag', properties: { backgroundColor: 'rgba(200, 200, 200, 0.5)', lineHeight: '200px', textAlign: 'center', cursor: 'pointer' } }); var draggable = new Draggable({

how can we get the size of a surface within famo.us?

回眸只為那壹抹淺笑 提交于 2019-11-29 11:56:47
If i create a famo.us surface giving a size of [true, true] and put some arbitrary html content into it, is there a clean way to retrieve the size of the object? surface.getSize() just returns the same [true,true] I noticed there are some apparently private methods such as: s._currTarget.clientHeight but it seems asking for trouble to use those! There are a couple of ways to solve this issue. Famo.us is aware of this limitation and it should be pretty high on the priority list.. In this example, a new surface class is created that emits an event in the deploy function or when the surface is

How to remove nodes from the Render Tree?

▼魔方 西西 提交于 2019-11-27 12:20:26
问题 I feel like I'm missing something obvious, but how do I remove nodes from the render tree and destroy them correctly? It looks like I can just do something like mainCtx._node._child.splice(2,1) , but this doesn't work in all cases (Scrollviews seem to stick around), and assume there's something relevant in the API but I can't seem to find it. 回答1: You never remove renderNodes - you use smart RenderNodes to manipulate what is rendered. The solution depends on what you want to accomplish: 1) I