A
A
Alex Zi2015-11-10 00:50:19
JavaScript
Alex Zi, 2015-11-10 00:50:19

How to initialize multiple jquery plugins on one page?

Please tell me how to initialize different plugins on the same page.
The second one and the next ones don't work for me. The scheme is as follows:

$(document).ready(function() {
    $("#selector-1").plugin-1(); // срабатывает
    $("#selector-2").plugin-2(); // не срабатывает, здесь у меня по факту не плагин, а виджет jquery ui slider
     $("#selector-3").plugin-3(); // не срабатывает
});


Let's say I want to use a plugin for a slider, another plugin for tabs, and even some kind of jquery ui widget on the page.
If this is only solved with jQuery.noConflict(), then plugins 2, 3 and later won't conflict with each other? I do not get you...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2015-11-10
@Zidkov

Any 'plugin' is a regular jquery object method, more precisely its prototype. Therefore, you can use as many plugins as you want at the same time, that's absolutely right, no Conflict. In your case, I'm sure that you simply did not connect two other plugins, or they have required parameters, and all plugins are called without them.

S
Stalker_RED, 2015-11-10
@Stalker_RED

Open the console in the browser (F12) and look at the errors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question