Wikia

Layton Wiki

Monobook.js

Talk0
2,299pages on
this wiki

MediaWiki page

Note: After saving, you have to bypass your browser's cache to see the changes.

  • Internet Explorer: hold down the Ctrl key and click the Refresh or Reload button, or press Ctrl+F5.
  • Firefox: hold down the Shift key while clicking Reload; alternatively press Ctrl+F5 or Ctrl-Shift-R.
  • Opera users have to clear their caches through Tools→Preferences
  • Konqueror and Safari users can just click the Reload button.
  • Chrome: press Ctrl+F5 or Shift+F5
/* Any JavaScript here will be loaded for users using the MonoBook skin */
/* See also: [[MediaWiki:Common.js]] */
 
/** Sub navigation menus (Monobook version) *****************************
 *
 * Allows you to create dynamic sub navigation menus.
 * Can be tweaked to contain an infinite amount of submenus.
 *
 * Code by [[User:Tjcool007]] from http://layton.wikia.com/
 */
 
$.get('http://layton.wikia.com/index.php?title=MediaWiki:SuperSidebar&action=raw&templates=expand&usemsgcache=yes', function(data) {
    $('#p-Navigation').html(data);
 
    $(".WikiaPage .subnav li").hover(function() {
        $(this).parent().css({width: $(this).parent().innerWidth()});
 
        if (/opera/i.test(navigator.userAgent)) {
            //innerwidth instead of outerwidth, also a bit less high. 
            $(this).find('ul:first').css({visibility: "visible !important", display: "none", left: $(this).innerWidth(), top: "-25px"}).show(150);
        } else {
            if (/msie/i.test(navigator.userAgent)) {
                //Problems with :first, so let's do it the old way.
                $(this).find('ul').eq(0).css({visibility: "visible !important", display: "none", left: $(this).outerWidth()}).show(150);
            } else {
                $(this).find('ul:first').css({visibility: "visible !important", display: "none", left: $(this).outerWidth()}).show(150);
            }
        }
    }, function() {
        $(this).find('ul').css({visibility: "hidden !important"}).hide();
    });
});

Around Wikia's network

Random Wiki