1function GoToAccordion(collapsename, actiontype, scrollto, collapseyn) { 2 /* This Javascript function can be called from any link on a page 3 * it scrolls the user to the accordion then triggers its collapse function */ 4 5 $('html, body').animate({ 6 scrollTop: parseInt($('#' + scrollto).offset().top - 80) 7 }, 500); 8 9 $('#'+collapsename).collapse(actiontype); 10 11 window.location.hash = scrollto; 12 //return (false); 13} 14 15$(document).ready(function () { 16 /* Intercepts an accordion as it is collapsing to scroll to the top of it 17 * Calculates an offset but only if the accordion's data-parent attribute is customised */ 18 $('.panel-collapse').on('show.bs.collapse', function (e) { 19 var callingid = ($(e.target).siblings('.panel-heading').find('a').attr('data-parent')); 20 21 var $panel = $(this).closest('.panel'); 22 var $open = $(this).closest('.panel-group').find('.panel-collapse.in'); 23 24 var additionalOffset = 0; 25 if (($panel.prevAll().filter($open.closest('.panel')).length !== 0) && (callingid != "#accordion")) { 26 additionalOffset = $open.height(); 27 } 28 $('html,body').animate({ 29 scrollTop: $panel.offset().top - additionalOffset 30 }, 500); 31 }); 32});
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.