How to live plugin in jQuery?

Can I add a live function to the plugin?

JPikcer plugin not working I create it from .live ('click', function (e)

Example: $ ('Multiple.) JPicker () ;.

Thanks Gino

+3
source share
1 answer

You cannot use .live()for this, the closest equivalent to this is the .livequery()plugin. .live()is an event listener , listening for bubble events, not new elements.

In addition, you start the plugin with this selector and context when adding new elements, for example. in the query $.ajax(), something like this:

$.ajax({
  //options...
  success: function(data) {
    $('.Multiple', data).jPicker();
  }
});
+4
source

Source: https://habr.com/ru/post/1746490/


All Articles