Search code examples
jqueryextend

Call wPaint extended function


I have extended the functions of wPaint in a plugin file like this:

$.fn.wPaint.extend({ mask: function () { ... } });

I can call it from within the plugin file with this.mask(); without problem.

I need to call it in an initialisation js but I can not find the right syntax. So far, I tried a few ones, including:

var ee1 = $('#wPaint').wPaint;
ee1.mask();

or

$('#wPaint').wPaint.mask();

but without success (mask is not a function) !

Expert advice needed, please...


Solution

  • Here is the solution:

    $('#wPaint').wPaint('mask');