MediaWiki:Common.js: различия между версиями

Материал из SAMP
Нет описания правки
Нет описания правки
 
(не показана 1 промежуточная версия этого же участника)
Строка 12: Строка 12:
$(document).on('click','.index_subelem', function()
$(document).on('click','.index_subelem', function()
{
{
var link = $(this).html;
var link = $(this).html();
alert(link);
document.location.href = 'https://wiki.samp.world/index.php/'+link;
});
});

Текущая версия от 00:57, 1 июня 2025

/* Размещённый здесь код JavaScript будет загружаться пользователям при обращении к каждой странице */

$(document).on('click','.index_elem', function(event)
{
	var target = event["target"]["parentElement"]["className"];
	if (target != "index_subelems")
	{
		if ($(this).hasClass('active'))	{ $(this).removeClass('active'); }
		else { $(this).addClass('active');	}
	}
});
$(document).on('click','.index_subelem', function()
{
	var link = $(this).html();
	document.location.href = 'https://wiki.samp.world/index.php/'+link;
});