A
A
Ainur Valiev2019-01-30 11:32:22
1C-Bitrix
Ainur Valiev, 2019-01-30 11:32:22

Where to call the jquery plugin in Bitrix?

included fancybox plugin files in component_epilog.php of the component

Asset::getInstance()->addCss(SITE_TEMPLATE_PATH."/libs/fancybox/source/jquery.fancybox.css", true);
 Asset::getInstance()->addJs(SITE_TEMPLATE_PATH."/libs/fancybox/source/jquery.fancybox.js", true);

they got hooked.
The question is: where to call the $('.fancybox').fancybox(); ?
In the template of the template.php component itself (it used to work), or in the general js file, which is included in the header - in both cases it says
$(...).fancybox is not a function
P.S. I solved the problem by connecting the bib in the footer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jupiter Max, 2019-01-31
@vardoLP

$(...).fancybox is not a function jQuery then included?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question