I am tying to apply some jQuery behaviour to two elements with their own css classes.
I am selecting the two classes like this…
$(".product-contain, .page-id-31").find("a:has(img)").fancybox({
However the script only works on the 2nd selector. I have tried various ways but cannot think of a proper way to do it, and I do not really wish to duplicate the code just for the other selector.
What is the correct way of applying the script to the above two selectors?
Thanks in advance.
Use each() to call with
everyelementreturnedby selector, currentlyfancybox()is only called with the element atzeroindex returned by the selector.