; (function ($) { $.extend({ 'nicenav': function (con) { con = typeof con === 'number' ? con : 400; var $lis = $('#nav>li') begin_left = $('.header .nav li>a.on').parents("li").position().left $h = $('#buoy') $('#buoy').css("left",begin_left) $lis.hover(function () { $h.stop().animate({ 'left': $(this).offsetParent().context.offsetLeft }, con); }, function () { $h.stop().animate({ 'left': begin_left }, con); }) } }); }(jQuery));