Line 1,779: | Line 1,779: | ||
} | } | ||
}); | }); | ||
+ | </script> | ||
+ | |||
+ | <script> | ||
+ | initiateNavigation("practices"); | ||
+ | $('#accordion2').on('shown.bs.collapse', function (e) { | ||
+ | |||
+ | // Validate this panel belongs to this accordian, and not an embedded one | ||
+ | var actualAccordianId = $('a[href="#' + $(e.target).attr('id') + '"').data('parent'); | ||
+ | var targetAccordianId = '#' + $(this).attr('id'); | ||
+ | if (actualAccordianId !== targetAccordianId) return; | ||
+ | |||
+ | var clickedHeader = $(this).find('.panel > .collapse.in').closest('.panel').find('.panel-heading'); | ||
+ | var offset = clickedHeader.offset(); | ||
+ | var top = $(window).scrollTop(); | ||
+ | if(offset) { | ||
+ | var topOfHeader = offset.top; | ||
+ | if(topOfHeader < top) { | ||
+ | $('html,body').animate({ scrollTop: topOfHeader}, 700, 'swing'); | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | $('#accordion1company').on('shown.bs.collapse', function (e) { | ||
+ | |||
+ | // Validate this panel belongs to this accordian, and not an embedded one | ||
+ | var actualAccordianId = $('a[href="#' + $(e.target).attr('id') + '"').data('parent'); | ||
+ | var targetAccordianId = '#' + $(this).attr('id'); | ||
+ | if (actualAccordianId !== targetAccordianId) return; | ||
+ | |||
+ | var clickedHeader = $(this).find('.panel > .collapse.in').closest('.panel').find('.panel-heading'); | ||
+ | var offset = clickedHeader.offset(); | ||
+ | var top = $(window).scrollTop(); | ||
+ | if(offset) { | ||
+ | var topOfHeader = offset.top; | ||
+ | if(topOfHeader < top) { | ||
+ | $('html,body').animate({ scrollTop: topOfHeader}, 700, 'swing'); | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | $('#accordion_tool').on('shown.bs.collapse', function (e) { | ||
+ | |||
+ | // Validate this panel belongs to this accordian, and not an embedded one | ||
+ | var actualAccordianId = $('a[href="#' + $(e.target).attr('id') + '"').data('parent'); | ||
+ | var targetAccordianId = '#' + $(this).attr('id'); | ||
+ | if (actualAccordianId !== targetAccordianId) return; | ||
+ | |||
+ | var clickedHeader = $(this).find('.panel > .collapse.in').closest('.panel').find('.panel-heading'); | ||
+ | var offset = clickedHeader.offset(); | ||
+ | var top = $(window).scrollTop(); | ||
+ | if(offset) { | ||
+ | var topOfHeader = offset.top; | ||
+ | if(topOfHeader < top) { | ||
+ | $('html,body').animate({ scrollTop: topOfHeader}, 700, 'swing'); | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | |||
</script> | </script> | ||
Revision as of 17:20, 16 September 2016