How to unbind non-custom events in a jQuery plugin

时间:2016-02-12 21:18:09

标签: jquery plugins destroy

I'm doing a plugin and I have a few events like this one:

gulp test

Also a $(window).on('load resize', function(event) { _plugin.methodCall(); }); event. How do I unbind these in my destroy function without messing other user-defined events?

Or is it better to get creative with custom events?

1 个答案:

答案 0 :(得分:1)

You can use jQuery .off in combination with namespaces when attaching event with from django.db.models import Max Model.objects.filter(user_id=100).values('object_id').annotate(Max('id'))

".on"