MediaWiki:Common.js:修订间差异
跳转到导航
跳转到搜索
(创建页面,内容为“→这里的任何JavaScript将为所有用户在每次页面加载时加载。: mw.loader.using('jquery').then(function() { $('sup.reference').hover(function(e) { var refId = $(this).find('a').attr('href'); var $ref = $(refId); if ($ref.length) { var tip = $('<div class="ref-tooltip"></div>') .html($ref.html()) .css({ position: 'absolute', top: e.…”) |
小 (测试) 标签:替换 已被回退 |
||
| 第1行: | 第1行: | ||
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */ |
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */ |
||
mw.loader.using('jquery').then(function() { |
|||
$('sup.reference').hover(function(e) { |
|||
var refId = $(this).find('a').attr('href'); |
|||
var $ref = $(refId); |
|||
if ($ref.length) { |
|||
var tip = $('<div class="ref-tooltip"></div>') |
|||
.html($ref.html()) |
|||
.css({ |
|||
position: 'absolute', |
|||
top: e.pageY + 10, |
|||
left: e.pageX + 10, |
|||
padding: '5px', |
|||
background: '#fff', |
|||
border: '1px solid #ccc', |
|||
'max-width': '300px', |
|||
'z-index': 10000 |
|||
}) |
|||
.appendTo('body'); |
|||
$(this).data('tooltip', tip); |
|||
} |
|||
}, function() { |
|||
var tip = $(this).data('tooltip'); |
|||
if (tip) tip.remove(); |
|||
}).mousemove(function(e) { |
|||
var tip = $(this).data('tooltip'); |
|||
if (tip) tip.css({ top: e.pageY + 10, left: e.pageX + 10 }); |
|||
}); |
|||
}); |
|||
2025年10月28日 (二) 16:19的版本
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */