A
A
Aptixx2014-06-29 14:25:19
JavaScript
Aptixx, 2014-06-29 14:25:19

Mootools code does not work in joomla 3, what should I change in the code?

Hello! Site on Joomla 3. The following code in the script does not work:

$$('#filter_type_id',
       '#filter_department_id',
       '#filter_town_id',
       '#filter_area_id',
       '#rooms_min',
       '.amenities input'
       ).each(function(item) {
        item.addEvent('change', function() {
          geoSearch.refresh();
        });
    });


When changing the value of elements, a function must be executed that is not currently being executed. All other code that does not contain the $$ function is executed correctly. Tell me how to change this code so that it works on Joomla 3 (Jquery and Jquery noConflict are connected by default by the engine itself)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Y
Yuri, 2016-02-28
@riky

firstly, clearInterval
and secondly, you immediately call the function like
this

кнопка.addEventListener ("mouseup" , function() { 
    clearInterval(timerId); 
} , false);

L
lubezniy, 2016-02-28
@lubezniy

Actually, clearInterval should be used instead of clearTimeout .

O
ocatoll, 2014-07-03
@ocatoll

Does the console complain about something?

A
andrfromnmsk, 2014-07-03
@andrfromnmsk

If it's a compatibility problem, since version 1.2 Mootools allows you to use not only the dollar sign $, but also the document.id method.
You can try wrapping your code like this:

(function($) {
     //здесь можно писать любой код на Mootools с использованием $
})(document.id);

For other errors, the console will help you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question