简体   繁体   中英

Is there any ways to add floating effect on arbor.js

I'm using arbor.js to create text node on iPhone/iPad page.

I want to add floating effect to each text node, that text node objects move constantly without touching display like jqFloat . (arbor.js gravity parameter don't work without touch events)

The format of my text node is written like below,

var data = {
    nodes: {
        node1: {
            'color': 'red',
            'shape': 'dot',
            'label': 'test1'
        },
        node2: {
            'color': 'green',
            'shape': 'dot',
            'label': 'test2'
        },
        node3: {
            'color': 'blue',
            'shape': 'dot',
            'label': 'test3'
        }
    },
    edges: {
        threadstarter: {
            node1: {},
            node3: {}
        }
    }
};
var sys = arbor.ParticleSystem();
sys.parameters({
    stiffness: 900,
    repulsion: 2000,
    gravity: true,
    dt: 0.015
});
sys.graft(data);

I would really appreciate your help in answering this question.

您是否尝试将sys.parameters.friction设置为0?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM