Mudanças entre as edições de "MediaWiki:Common.js"
Ir para navegação
Ir para pesquisar
| Linha 1: | Linha 1: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
const offset = { x: 20, y: 10 }; | |||
$('.test').hover(function(e) { | $('.test').hover(function(e) { | ||
var src = $(this).attr('src'); | var src = $(this).attr('src'); | ||
| Linha 11: | Linha 8: | ||
}, function(){ | }, function(){ | ||
$('#bigImage').remove(); | $('#bigImage').remove(); | ||
}); | }); | ||
$('.test').mousemove(function(e) { | |||
$('#bigImage').css('left', e.pageX + offset.x).css('top', e.pageY + offset.y) | |||
}); | |||
}); | }); | ||
Edição das 05h15min de 28 de maio de 2022
$(document).ready(function() {
const offset = { x: 20, y: 10 };
$('.test').hover(function(e) {
var src = $(this).attr('src');
$('<img src="'+ src +'" id="bigImage" />').css('left', e.pageX + offset.x).css('top', e.pageY + offset.y).appendTo('body').hide().fadeIn(500);
}, function(){
$('#bigImage').remove();
});
$('.test').mousemove(function(e) {
$('#bigImage').css('left', e.pageX + offset.x).css('top', e.pageY + offset.y)
});
});