Use behaviors:
Drupal.behaviors.myModule = {
attach: function(context, settings) {
$('#img-id', context).once('my-module').applyZoomPlugin();
}
};
Kickstart does things properly and also hooks into behaviors, so once any AJAX request has completed on the page, your attach
method will be invoked. To make sure an individual image element doesn't get the plugin applied multiple times, for example if AJAX is used elsewhere non the page, unrelated to the product image, use once()
as above.