« MediaWiki:Common.js » : différence entre les versions
Aller à la navigation
(Page blanchie) |
Aucun résumé des modifications |
||
Ligne 1 : | Ligne 1 : | ||
$(document).mousemove(function(e){ | |||
var width | |||
var height | |||
var w = e.pageX; | |||
if (e.clientX < ($(window).width())/2){ | |||
width = w + 20; | |||
} else { | |||
width = w - 60 - $('.popup_window').width() | |||
} | |||
var h = e.pageY; | |||
var h2 = $('.popup_window').height() | |||
var h3 =$(window).height() | |||
if (e.clientY < (h3/2)){ | |||
height = h + 10; | |||
if (e.clientY + h2 + 30 > h3) height = h + (h3-e.clientY) - h2 - 30 | |||
} else { | |||
height = h - 40 - h2 | |||
if (e.clientY - h2 < 0) height = h - e.clientY | |||
} | |||
$('.popup_window').css({top: height, left: width}); | |||
}); | |||
function pop(content){ | |||
$('#popup_contents').html(content) | |||
$('.popup_window').show() | |||
} | |||
function hide(){ | |||
$('.popup_window').hide() | |||
$('#popup_contents').html('') | |||
} |
Version du 14 juillet 2016 à 07:26
$(document).mousemove(function(e){ var width var height var w = e.pageX; if (e.clientX < ($(window).width())/2){ width = w + 20; } else { width = w - 60 - $('.popup_window').width() } var h = e.pageY; var h2 = $('.popup_window').height() var h3 =$(window).height() if (e.clientY < (h3/2)){ height = h + 10; if (e.clientY + h2 + 30 > h3) height = h + (h3-e.clientY) - h2 - 30 } else { height = h - 40 - h2 if (e.clientY - h2 < 0) height = h - e.clientY } $('.popup_window').css({top: height, left: width}); }); function pop(content){ $('#popup_contents').html(content) $('.popup_window').show() } function hide(){ $('.popup_window').hide() $('#popup_contents').html('') }