拉斐尔订购物品 [英] Raphael order objects

查看:145
本文介绍了拉斐尔订购物品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试订购Raphael物品。我没有决定何时创建对象的选项,但是我想在创建对象后使一组对象出现在一组其他对象后面。有人可以帮我这么做吗?

I'm trying to order Raphael objects. I don't have the option of deciding when the objects are created, but I'd like to make a group of objects appear behind a group of other objects after they've been created. Can anybody help me do this?

谢谢。

推荐答案

集团您在两个设置中的项目,并使用 insertBefore insertAfter

Group you items in two sets and position the sets relative to each other with insertBefore or insertAfter:

var front = paper.set();
front.push(front1, front2);

var back = paper.set();
back.push(back1, back2);

front.insertBefore(back);

此外,如果您的物品在数组中,您可以使用 apply 为方便起见:

Also if you have your items in arrays you can use apply for convenience:

var frontItems = [front1, front2];
front.push.apply(null, frontItems);

这篇关于拉斐尔订购物品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆