Skip to content

Instantly share code, notes, and snippets.

@Aphyxia
Last active January 30, 2016 00:19
Show Gist options
  • Save Aphyxia/424c5f4f74e91604a304 to your computer and use it in GitHub Desktop.
Save Aphyxia/424c5f4f74e91604a304 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Hover open menu
// @namespace http://myanimelist.net/profile/Aphyxia
// @description On list menu hover show content
// @include http://myanimelist.net/*
// @version 1
// @grant none
// ==/UserScript==
(function () {
if (typeof jQuery == 'undefined') $ = unsafeWindow.$;
$('.header-list').on('hover', function () {
$(this).addClass('on');
$('.header-list-dropdown').show();
});
$('.header-list').on('mouseleave', function () {
setTimeout(function ()
{
if (!($('.header-list-dropdown').is(':hover')) && !($('.header-list').is(':hover'))) {
$('.header-list-dropdown').hide();
$(this).removeClass('on');
}
}, 400);
});
$('.header-list-dropdown').on('mouseleave', function () {
setTimeout(function ()
{
if (!($('.header-list').is(':hover')) && !($('.header-list-dropdown').is(':hover'))) {
$('.header-list-dropdown').hide();
$(this).removeClass('on');
}
}, 400);
});
}) ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment