mirror of
https://gh.wpcy.net/https://github.com/BracketSpace/WP-Admin-Reference.git
synced 2026-07-16 11:26:34 +08:00
24 lines
548 B
JavaScript
24 lines
548 B
JavaScript
function sectionMenu() {
|
|
|
|
const elm = document.querySelector('#adminmenu');
|
|
const ms = new MenuSpy(elm,{
|
|
activeClass : 'current',
|
|
threshold : 15,
|
|
} );
|
|
|
|
jQuery( 'a' ).on( 'click', function( e ) {
|
|
if ( this.hash !== '' ) {
|
|
e.preventDefault();
|
|
var hash = this.hash;
|
|
jQuery( 'html, body' ).animate( {
|
|
scrollTop: jQuery( hash ).offset().top
|
|
}, 300, function(){
|
|
window.location.hash = hash;
|
|
} );
|
|
}
|
|
});
|
|
|
|
jQuery( '.menu-top' ).on( 'click', function() {
|
|
jQuery( '#wpwrap' ).removeClass( 'wp-responsive-open' );
|
|
});
|
|
}
|