1// $Id$ 2 3/** 4 * @file 5 * OM Maximenu script 6 * 7 * @author: Daniel Honrade http://drupal.org/user/351112 8 * 9 */ 10 11jQuery(document).ready(function($){ 12 //back to top scroll function. Any link with a hash (#) will scroll to that id on the page 13 $('.om-maximenu li.om-leaf a').addClass('om-autoscroll'); 14 15 $('a.om-autoscroll[href*=#]').click(function() { 16 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 17 var $target = $(this.hash); 18 $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']'); 19 if ($target.length) { 20 var targetOffset = $target.offset().top; 21 //targetOffset = targetOffset - 90; 22 $('html,body').animate({scrollTop: targetOffset - 0}, 500); 23 return false; 24 } 25 } 26 }); 27 // stay open 28 $('.om-maximenu-open input').each(function() { 29 //alert($(this).attr('checked')); 30 // jQuery 1.7 has changed it's value checking for checkbox to checked instead of true 31 if(($(this).attr('checked') == true) || ($(this).attr('checked') == 'checked')) { 32 $(this).parent().parent().addClass('open'); 33 $(this).parent().parent().parent().addClass('open'); 34 $(this).parent().parent().removeClass('closed'); 35 } 36 else { 37 $(this).parent().parent().removeClass('open'); 38 $(this).parent().parent().parent().removeClass('open'); 39 $(this).parent().parent().addClass('closed'); 40 } 41 }); 42 $('.om-maximenu-open input').click(function() { 43 //alert($(this).attr('checked')); 44 if(($(this).attr('checked') == true) || ($(this).attr('checked') == 'checked')) { 45 $(this).parent().parent().addClass('open'); 46 $(this).parent().parent().parent().addClass('open'); 47 $(this).parent().parent().removeClass('closed'); 48 } 49 else { 50 $(this).parent().parent().removeClass('open'); 51 $(this).parent().parent().parent().removeClass('open'); 52 $(this).parent().parent().addClass('closed'); 53 } 54 }); 55 // image hover replacement 56 $('.om-maximenu img.om-hover').hover(function () { 57 var src = $(this).attr('src'); 58 var altsrc = src.replace(/([^.]+)(\.[^.]+$)/, '$1_hover$2'); 59 $(this).attr({ src: altsrc, altsrc: src }); 60 },function () { 61 var src = $(this).attr('src'); 62 var altsrc = src.replace(/_hover/, ''); 63 $(this).attr({ src: altsrc, altsrc: src }); 64 }); 65});
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.