G
G
gregorypetrov2017-07-14 15:11:11
JavaScript
gregorypetrov, 2017-07-14 15:11:11

How to avoid duplicate code when linking fancybox to different link classes?

Good afternoon, colleagues!

I have the Fancybox plugin hooked to links with the class link_type_ 1, for example:

jQuery("a.link_type_1").fancybox({

             ...

            });


I want to make the fantasybox process not only links with the link_type_1 class , but also, for example, link_type_2 . How to do it so as not to duplicate the code?

Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tyzberd, 2017-07-14
@tyzberd

jQuery("a.link_type_1, a.link_type_2").fancybox({

             ...

            });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question