• 若在站点范围内使用,管理员可以将以下代码添加至wiki的MediaWiki:ImportJS页面。
  • 若供个人使用,请将以下代码片段添加到您的global.js页面(在所有wiki使用)或您的common.js页面(在单一站点使用)。注意,您的帐户必须启用个人JS才能使用。
    type: 'script',
    articles: [


可以使用此工具內建的UI。你可以設定點擊開啟、滑鼠逗留多久開啟及關閉彈窗開關的動畫效果。你也可以直接把這個功能關掉,每個用戶的設定都不會影響到其他用戶。 即使彈窗停止運作,還是能在分類下找到彈窗的UI設定行,點擊UI就能重新設定彈窗。



  • 關閉來源彈窗(Disable Reference Popups)-這會永久地關閉彈窗功能。使用文章下的「設置來源彈窗(Configure Reference Popups)」能重新開啟。某些Wiki會鎖住彈窗以避免讀者把它關掉。你可以連絡個別維基的管理員。
  • 游標暫留(Hover delay)-可以設定滑鼠需要在引用上停留多少時間(設定以毫秒為單位)才能打開彈窗。預設為200毫秒。請注意,設定時間太短的話會非常干擾閱讀。
  • 再次觸碰才會消失(Make popups stay open until touched with the mouse)-彈窗一出現後、直到游標再次經過前都不會消失。這樣就不用讓游標一直停在引用記號上。
  • 開啟方式(Activate by)-在預設中需要游標停留才能開啟彈窗;可以切換成滑鼠點擊開啟彈窗。在滑鼠點擊模式中,彈窗開啟時再次點擊引用就能關掉它,但你也會因此被移動到文章下方的參考來源。
  • 開關動畫(Enable Open/Close Animations)-彈窗在預設中有開啟/關閉的動畫(約300毫秒)。一般來說比起直接開啟,這樣對眼睛比較好。但如果不在意的話,你可以關掉它。

Administrator Configuration

Administrators can remove the gadget's configuration link from their wiki by putting Reference Popups into "lockdown" mode. This will force the popups to stay enabled and remove the configuration link from the end of the article, but not from the popup itself.

To enable lockdown, just add this to MediaWiki:Common.js above the aforementioned import:

(( = || {}).ReferencePopups = dev.ReferencePopups || {}).lockdown = true;

You can also alter the defaults for new users. You can disable the animation by default using:

(( = || {}).ReferencePopups = dev.ReferencePopups || {}).defaults = { animate: false };

Custom Popups

The popup component of this script is fully reusable and can be repurposed to display anything you want as well as references. A pre-made script and template set is provided if you just want something to drop in and use. Alternatively, if you are capable of writing your own JavaScript, you can instead code against the popups directly to do things like AJAX new content and display it in a popup as certain elements are interacted with.

To use the custom popups, you will need to import the Custom Popup script:


And you will need to copy these 2 templates onto your wiki to make use of the script:

The templates describe how to use them.

An important thing to note is that the custom popup script will use the user's ReferencePopup configuration even though the gear icon doesn't appear in custom ones. This means that if the popup is in click mode then attaching popups to page elements that already have their own scripts can have strange consequences. Unlike normal popups, custom ones are never sticky and can't be disabled though.

You can also construct custom skins for you custom popups as well. An example of this is on the demo page, you can see the CSS for it over here.

Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+