jquery.nicenav.js 651 B

1234567891011121314151617181920
  1. ; (function ($) {
  2. $.extend({
  3. 'nicenav': function (con) {
  4. con = typeof con === 'number' ? con : 400;
  5. var $lis = $('#nav>li')
  6. begin_left = $('.header .nav li>a.on').parents("li").position().left
  7. $h = $('#buoy')
  8. $('#buoy').css("left",begin_left)
  9. $lis.hover(function () {
  10. $h.stop().animate({
  11. 'left': $(this).offsetParent().context.offsetLeft
  12. }, con);
  13. }, function () {
  14. $h.stop().animate({
  15. 'left': begin_left
  16. }, con);
  17. })
  18. }
  19. });
  20. }(jQuery));