A
A
Alexey Parkhomenko2015-11-23 16:29:15
PHP
Alexey Parkhomenko, 2015-11-23 16:29:15

How to make the active menu item (CMS joomla) non-clickable using php or js?

Here is the code

<ul class="sj-flat-menu flyout-menu vertical fm-active" id="sj_flat_menu_17356473091448285129"><!--<![endif]-->
            <li class="fm-active  fm-first"><div class="fm-item "><div class="fm-button"></div><div class="fm-link"><a href="/mezhdunarodnye-perevozki">Международные перевозки</a></div></div></li><li><div class="fm-item "><div class="fm-button"></div><div class="fm-link"><a href="/strakhovanie">Страхование</a></div></div></li><li><div class="fm-item "><div class="fm-button"></div><div class="fm-link"><a href="/temperaturnyj-rezhim-ot-20-s-do-20-s">Температурный режим от + 20 С  до -20 С</a></div></div></li><li><div class="fm-item "><div class="fm-button"></div><div class="fm-link"><a href="/sertifitsirovannyj-registrator-rtr">Сертифицированный регистратор. Регистрация температурного режима</a></div></div></li><li><div class="fm-item "><div class="fm-button"></div><div class="fm-link"><a href="/prodazha-diztopliva-so-skidkoj">Продажа дизтоплива со скидкой</a></div></div></li><li><div class="fm-item "><div class="fm-button"></div><div class="fm-link"><a href="/sanitarnaya-obrabotka-avtomobilej">Санитарная обработка автомобилей</a></div></div></li><li class="fm-last"><div class="fm-item "><div class="fm-button"></div><div class="fm-link"><a href="/svoj-transport-foto">Свой транспорт (фото)</a></div></div>    </li>
</ul>

It is necessary that, for example, when you are on the "Insurance" page. The insurance menu item became inactive, that is, it could not be clicked on and would not follow the link, of course, to this very page.
Thanks for your help, in advance.!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
prodavec macdonalds, 2015-11-23
@Versale

$( document ).ready(function() {
    $('.fm-active a').attr('href', 'javascript:void()');
});

A
Abror Jakey, 2015-11-23
@ayyjay

According to the idea above, the correct answer is written! But if we take into account that the parent Ul also has the .fm-active class, then it remains just to access it through li!

$('li.fm-active a').attr('href', 'javascript:void()');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question