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

Snap.plugin(f)

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

Let you write plugins. You pass in a function with five arguments, like this:

Snap.plugin(function (Snap, Element, Paper, global, Fragment) {
Snap.newmethod = function () {};
Element.prototype.newmethod = function () {};
Paper.prototype.newmethod = function () {};
});

Inside the function you have access to all main objects (and their prototypes). This allow you to extend anything you want.

Parameters

  1. ffunctionyour plugin body