Unverified

Name

Hide Admin Bar with jQuey

About

Hides and displays the Admin Bar when scrolling

Language

Javascript

Rating

Voted: 0 by 0 user(s)

How to Setup Snippet

Change the value of this variable to modify the distance in pixels from the top at which the Admin Bar will be hidden, it will be shown again when you scroll up and reach that position.

Codevault

oxygenados

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

06/12/2022

Important Note

This snippet has the following status:

Unverified

This snippet has not been verified, use with caution and at your own risk. See details provided by author in sidebar and click below to find out more.

Hide Admin Bar with jQuey

 
                    
1var distanciaArriba = 100;
2jQuery(window).on("scroll", function () {
3 var topeScroll = jQuery(window).scrollTop();
4 if (topeScroll > distanciaArriba) {
5 jQuery("#wpadminbar").attr(
6 "style",
7 "top:0 !important; display:none !important; position: static !important"
8 );
9 jQuery(".oxy-header-wrapper").attr("style", "top:0 !important");
10 } else {
11 jQuery("#wpadminbar").attr("style", "");
12 }
13});

0

Related Snippets

Please see some snippets below related to this snippet..

WordPress Admin

AI Verified

0

Block Editor: Alt+Shift+Minus to Toggle Block Outline List View [SnipSnip.pro]

Added: 9 months ago

Last Updated: 9 months ago

ADMIN ONLY • This code snippet enhances the Gutenberg Block Editor in WordPress by adding a keyboard shortcut. By pressing Alt+Shift+Minus, users can toggle the Block Outline List View, which provides...

WordPress Admin

AI Verified

0

Add icons to the custom post types in the At a Glance Dashboard widget

Added: 10 months ago

Last Updated: 10 months ago

This snippet adds custom icons to your custom post type counters in the At a Glance widgets on your WordPress Dashboard. I have a snippet in my Codevault on how to add CPTs to this widget too.

WordPress Admin

Pro Verified

0

Hide some items on the Wordpress Sidebar

Added: 1 year ago

Last Updated: 1 year ago

Maybe you want to hide the Plugin item or more from the Wordpress Dashboard Sidebar.

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

WordPress Admin

Unverified

0

Hide Admin Bar with jQuey

Added: 1 year ago

Last Updated: 1 year ago

Hides and displays the Admin Bar when scrolling