R
R
Riinamix2016-07-12 19:28:04
JavaScript
Riinamix, 2016-07-12 19:28:04

Why doesn't jQuery remove the class on Joomla 3.3?

Hello. There is a site on Joomla 3.3, in which some menu items are anchors that link to one page. There is a script that adds a class and highlights the active link (anchor), respectively, when you switch to another anchor, the class is removed and added to another anchor. The problem is that on a test page (not on Joomla), the same script works perfectly. On the site, removeClass does not work. Could there be a problem in Joomla? If not, how to get around it?
Here is the code:


jQuery(document).ready(function(){
$('.menu').click(function(){
$('.menu').removeClass('active');
$(this).addClass('active' );
return false;
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-07-12
@Riinamix

Is there anything additionally connected to the mootools type on the site? They conflict with JQ.
There are no errors in the code itself. If naturally the class "menu" is present for each menu item, and not for their wrapper.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question