Plugin Namespacing
Namespace your plugin to avoid conflicts. Use a prefix, namespace your events, and prefix CSS classes to prevent collisions with other plugins.
Namespace your plugin to avoid conflicts. Use a prefix, namespace your events, and prefix CSS classes to prevent collisions with other plugins.
// Plugin namespace: "myco"
$.fn.mycoCarousel = function() { /* ... */ };
// Namespaced events
$el.on("click.myco-carousel", handler);
$el.off(".myco-carousel"); // remove all myco events
// Namespaced CSS classes
// .myco-carousel-wrap
// .myco-slide
// .myco-active
Pick a short company or project prefix and use it consistently across all plugins.