I guess
body.scrollTop is deprecated in strict mode. Please use documentElement.scrollTop if in strict mode and body.scrollTop only if in quirks mode.
So I would suggest you to use document.documentElement.scrollTop. also let us know when are you using this statement? show us full code and your console error if possible
Please try the below code edited with respect to your comment code and let us know what you see in console.
jQuery(document).ready(function ($) {
jQuery(window).scroll(function(){
var ScrollTop = jQuery(window).scrollTop();
if (ScrollTop > 100) {
jQuery( ".site-header" ).addClass( "scroll" );
console.log("above 100");
}else{
jQuery( ".site-header" ).removeClass( "scroll" );
console.log("below or equal to 100");
}
});
});
Related Posts:
- force enqueue script to be first in order of prominence
- How can I make default jquery version of WordPress “async”?
- Handling jQuery Component Collision
- How to Add jQuery Infinite Scroll to My Custom Archive Page
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Editor not displaying dynamically after clicking on the button
- WordPress Enqueue Script Chaos (jQuery & Foundation.js)
- Check javascript file Proper way in functions.php
- How to load plugin before the wordpress jquery?
- WordPress Plugin development Call to undefined function jQuery()
- Why is my ajax call refreshing the page?
- How to create popup same as wordpress popup feature
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- Ajax with jQuery UI dialog not working
- Plugin allowing for artists, events and venues
- jQuery function didn’t work in my plugin
- WordPress 3.5 Media Manager – add a button
- Handling jQuery Component Collision
- How do I make sure a plugin loads a script after jQuery
- Add get_option to jquery
- Why is wp-cron only executing on page visit?
- Check if email address exists front end with AJAX in a plugin
- Confused about shortcode and settings values
- Running jquery script after shortcode [closed]
- JQuery not working in my plugin [closed]
- Notepad sticky plugin
- Bootstrap Drop Down menu is not working
- Events Plugin that works with existing categories?
- Change upload folder for a CPT
- How to hide CSS by default and show on button press
- Uncaught TypeError: jQuery(…).flipster is not a function in wordpress
- Redux Framework: Page freezes on typing in Editor
- How can I inject options into an select tag inside the widget form?
- jquery tinymce and bundled wp plugins
- Display wordpress post’s in popup?
- Using color picker in plugin, does input attribute order matter?
- Loading a purchased jquery plugin in a wordpress theme
- Trying to create a table/list of my EventBrite course listings [closed]
- Create shortcode to echo javascript
- how to insert data in wordpress table usnig jquery ajax
- Stop WordPress processing Javascript as text
- How does one include the JQuery UI plugin to wordpress and enque it correctly in a plugin form?
- Remove Yoast jQuery from front end
- Is there a function to list all uploaded images? How can I add one?
- How to best create a jQuery Slider to display a native wordpress gallery?
- How to remove js ui library added by default by wordpress
- Creating a widget and missing jQuery
- Stop wordpress from requesting external jquery from googleapi
- Api external with wordpress
- JQuery needs to be defined in , but Gravity Forms is defining it in the
- Why do I get jQuery reference error / undefined when changing name of plugin file?
- Custom meta box with jQuery.sortable custom post type list
- How to prevent tabs from opening all at once
- Separate jQuery for Individual Comments?
- FancyBox JS stopped working on multiple sites. Custom plugin responsible. Urgent help needed
- jQuery(‘#news-ticker’).cycle is not a function
- Javascript from Easy-Fancybox place into footer
- WordPress plugin isn’t loading completely
- jQuery slider widget similar to cnet.com
- Problems with jQuery and is_admin()
- FacetWP breaks jQuery events
- WP Ajax DB issues
- Get the link title attribute and send it google analytics as custom label via google tag manager using beehive pro for WordPress
- jQuery Ajax not loading page with ACF fields
- Mixed content error after adding SSL certificate
- Website always load twice on start
- Hide button after form submit and save state to localstorage
- Uncaught TypeError: Cannot read property ‘cycle’ of undefined
- myStickymenu hide on scroll up to certain Y values
- How to solve Blocked a frame with origin from accessing a cross origin frame error in wordpress?
- jquery plugin won’t fire when hamburger class element clicked
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Overwriting Plugin’s Ajax callback function from theme
- jQuery to show icon after .hide
- Can’t find variable is_single in my jQuery plugin
- Specific plugin script not working on subdomain
- Not getting result using ajax on wordpress
- Theme Load Error
- How to Add Jquery FullCalendar in wp plugin in admin
- Plugin program: JQuery not working in this plugin
- Ajax, jQuery and WordPress
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- jQuery loaded in wrong order for non-admin page views only
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- PHP and Jquery pass value from form. Update function on DataBase
- WordPress plugin ajax post parameter
- Plugin use of ajax/jquery depending dropdown
- How do I output user_registered time in my correct timezone?
- Ajax in Plugins: returns the whole page
- Load css classes after using ajax calls
- How to resolve these findings from security audit
- Integrating WordPress Content into a jQuery Slider
- Animate like Stack exchange frequently asked questions [closed]
- Change page content based on dropdown selection
- Ajax button “Load more” is not loading correct language version posts for logged out users
- WordPress GiveWP Plugin showing blank page in none default theme [closed]
- How to write a plugin that “listens” every time, an edit occurs?
- Woocommerce attatch files and custom input meta to cart items and then to order
- Ajax response from Media Selection does not update ALL information more than once