Pablo

data(key)

The .data(key) method will return the associated value to that key on the collection.

var svg = Pablo(demoElement).svg({height: 100});
 circle = Pablo.circle({id: 'special', cx: 50, cy: 50, r: 50});
circle.data('ying', 'yang').appendTo(svg);
alert(Pablo('#special').data('ying'));

data(key, value)

The .data(key, value) method will set a key/value pair (overwriting if already set) on the collection.

data(object)

The .data(object) method will set multiple key/value pairs (overwriting if already set) on the collection if an object is passed in.

var rect = Pablo.rect();
rect.data({
 foo: 'bar',
 biz: {
 yin: 1,
 yan: 2
 }
});
alert(rect.data('foo'));
alert(rect.data('biz'));
Painting is just another way of keeping a diary.
Pablo Picasso

AltStyle によって変換されたページ (->オリジナル) /