1var maxHeight = 400; 2 3$(function(){ 4 5 $(".dropdown > li").hover(function() { 6 7 var $container = $(this), 8 $list = $container.find("ul"), 9 $anchor = $container.find("a"), 10 height = $list.height() * 1.1, // make sure there is enough room at the bottom 11 multiplier = height / maxHeight; // needs to move faster if list is taller 12 13 // need to save height here so it can revert on mouseout 14 $container.data("origHeight", $container.height()); 15 16 // so it can retain it's rollover color all the while the dropdown is open 17 $anchor.addClass("hover"); 18 19 // make sure dropdown appears directly below parent list item 20 $list 21 .show() 22 .css({ 23 paddingTop: $container.data("origHeight") 24 }); 25 26 // don't do any animation if list shorter than max 27 if (multiplier > 1) { 28 $container 29 .css({ 30 height: maxHeight, 31 overflow: "hidden" 32 }) 33 .mousemove(function(e) { 34 var offset = $container.offset(); 35 var relativeY = ((e.pageY - offset.top) * multiplier) - ($container.data("origHeight") * multiplier); 36 if (relativeY > $container.data("origHeight")) { 37 $list.css("top", -relativeY + $container.data("origHeight")); 38 }; 39 }); 40 } 41 42 }, function() { 43 44 var $el = $(this); 45 46 // put things back to normal 47 $el 48 .height($(this).data("origHeight")) 49 .find("ul") 50 .css({ top: 0 }) 51 .hide() 52 .end() 53 .find("a") 54 .removeClass("hover"); 55 56 }); 57 58 59 60 61}); 62 63
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.