I need to put a custom hover menu from http://www.addthis.com/help/toolbox, but Rails uses Prototype whereas the code given is in JQuery. I do not have much experience with either JavaScript library, if someone can help it'd be much appreciated!
$(function()
{
$('.custom_button, .hover_menu').mouseenter(function()
{
$('.hover_menu').fadeIn('fast');
$('.custom_button').addClass('active');
$(this).data('in', true);
$('.hover_menu').data('hidden', false);
}).mouseleave(function()
{
$(this).data('in', false);
setTimeout(hideMenu, delay);
});
var delay = 400;
function hideMenu()
{
if (!$('.custom_button').data('in') && !$('.hover_menu').data('in') && !$('.hover_menu').data('hidden'))
{
$('.hover_menu').fadeOut('fast');
$('.custom_button').removeClass('active');
$('.hover_menu').data('hidden', true);
}
}
});