Let’s say I have some code like this:
jQuery('#retouching-image-1').beforeAfter({
animateIntro: true,
introDelay: 500
});
jQuery('#retouching-image-2').beforeAfter({
animateIntro: true,
introDelay: 500
});
Rather than duplicating animateIntro: true, introDelay: 500 each time I need it, is it possible to put these values into some kind of re-useable variable?
Thanks.
Try the following
Another, probably more re-usable option is to use a class instead of an id to tag these elements. Say you added the `retouchImage’ class to every one of these items. Then you could simplify your code to the following