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

Нет описания правки
Нет описания правки
Строка 5: Строка 5:
     if ($(window).width() < 1023)
     if ($(window).width() < 1023)
     return;
     return;
   
    console.log($(this).parent().next('.tooltip'))
      
      
     $(this).parent().next('.tooltip')
     $(this).parent().next('.tooltip')

Версия от 18:38, 3 января 2022

$("[data-tooltip]").mousemove(function (eventObject) {
	var pos = $(this).position();
    var width = $(this).outerWidth();
    
    if ($(window).width() < 1023)
    	return;
    
    $(this).parent().next('.tooltip')
    	.css({ 
			"top" : (pos.top + 20) + "px",
			"left" : (pos.left + width + 5) + "px"
		})
		.show();

    }).mouseout(function () {

        $(".tooltip").hide()
			.css({
				"top" : 0,
				"left" : 0
	});
});