1(function($) { 2"use strict"; 3 $.fn.spasticNav = function(options) { 4 5 options = $.extend({ 6 overlap : 0, 7 speed : 500, 8 reset : 50, 9 color : '#00c6ff', 10 easing : 'swing' //'easeOutExpo' 11 }, options); 12 13 return this.each(function() { 14 15 var nav = $(this), 16 currentPageItem = nav.find('>.current-menu-item,>.current-menu-parent,>.current-menu-ancestor'), //>.current_page_parent 17 hidden = true, //false 18 blob, 19 reset; 20 if (currentPageItem.length === 0) { 21 currentPageItem = nav.find('li').eq(0); 22 //hidden = true; 23 } 24 25 $('<li id="blob"></li>').css({ 26 width : currentPageItem.css('width'), //.outerWidth(), 27 height : currentPageItem.css('height'), //.outerHeight() + options.overlap, 28 left : currentPageItem.position().left, 29 top : currentPageItem.position().top - options.overlap / 2, 30 backgroundColor : hidden ? options.color : currentPageItem.find('a').css('backgroundColor'), 31 opacity: hidden ? 0 : 1 32 }).appendTo(this); 33 blob = $('#blob', nav); 34 35 nav.find('>li:not(#blob)').hover(function() { 36 // mouse over 37 clearTimeout(reset); 38 var bg = $(this).css('backgroundColor'); 39 $(this).addClass('blob_over'); 40 blob.css({backgroundColor: bg}).animate( 41 { 42 left: $(this).position().left, 43 top: $(this).position().top - options.overlap / 2, 44 width: $(this).css('width'), //.outerWidth(), 45 height: $(this).css('height') + options.overlap, //.outerHeight() + options.overlap, 46 opacity: 1 47 }, 48 { 49 duration : options.speed, 50 easing : options.easing, 51 queue : false 52 } 53 ); 54 }, function() { 55 // mouse out 56 reset = setTimeout(function() { 57 /* 58 var a = currentPageItem.find('a'); 59 var bg = a.css('backgroundColor'); 60 */ 61 blob.animate({ 62 /* 63 width : currentPageItem.outerWidth(), 64 left : currentPageItem.position().left, 65 */ 66 opacity: 0 //hidden ? 0 : 1, 67 }, options.speed) 68 //.css({backgroundColor: bg}) 69 }, options.reset); 70 $(this).removeClass('blob_over'); 71 }); 72 73 74 }); // end each 75 76 }; 77 78})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.