@@ -38,19 +38,18 @@ jQuery(document).ready(function ($) {
3838 } // reset all tabs to aria-selected=false and normal font weight
3939 e . target . setAttribute ( 'aria-selected' , 'true' ) ; //set aria-selected=true for clicked tab
4040 for ( let i = 0 ; i < tabPanels . length ; i ++ ) {
41- tabPanels [ i ] . setAttribute ( 'aria-hidden' , 'true' ) ;
41+ tabPanels [ i ] . style . display = 'none' ;
4242 } // hide all tabpanels
4343 // If this is an inner tab panel, don't set the window location.
4444 if ( inside . length == 0 ) {
45- window . location . hash = tabPanelToOpen ;
45+ history . pushState ( null , null , '#' + tabPanelToOpen ) ;
4646 }
47- document . getElementById ( tabPanelToOpen ) . setAttribute ( 'aria-hidden' , 'false' ) ; //show tabpanel
47+ document . getElementById ( tabPanelToOpen ) . style . display = 'block' ;
4848 for ( let i = 0 ; i < iframes . length ; i ++ ) {
4949 let iframe = iframes [ i ] ;
5050 resizeIframe ( iframe ) ;
5151 }
5252 $ ( '#' + tabPanelToOpen ) . attr ( 'tabindex' , '-1' ) . trigger ( 'focus' ) ;
53- window . scrollTo ( 0 , 0 ) ;
5453 }
5554
5655 /**
@@ -72,10 +71,10 @@ jQuery(document).ready(function ($) {
7271 } //reset all tabs to aria-selected=false and normal font weight
7372 control . attr ( 'aria-selected' , 'true' ) ; //set aria-selected=true for clicked tab
7473 for ( let i = 0 ; i < tabPanels . length ; i ++ ) {
75- tabPanels [ i ] . setAttribute ( 'aria-hidden' , 'true' ) ;
74+ tabPanels [ i ] . style . display = 'none' ;
7675 }
7776 if ( null !== currentPanel ) {
78- currentPanel . setAttribute ( 'aria-hidden' , 'false' ) ; //show tabpanel
77+ currentPanel . style . display = 'block' ;
7978 }
8079 }
8180
0 commit comments