目录
当前位置: 首页 > 文档资料 > Snap.svg 英文文档 >

Paper.el(name, attr)

优质
小牛编辑
125浏览
2023-12-01

Creates an element on paper with a given name and no attributes

Parameters

  1. namestringtag name
  2. attrobjectattributes

Returns: Element the current element

Usage

var c = paper.circle(10, 10, 10); // is the same as...
var c = paper.el("circle").attr({
cx: 10,
cy: 10,
r: 10
});
// and the same as
var c = paper.el("circle", {
cx: 10,
cy: 10,
r: 10
});