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:
- Pass PHP variable to javascript
- WordPress 3.5 Media Manager – add a button
- Help making my pagination plugin better
- jQuery plugin only in one page/post
- Is dynamic forms/entries possible in Widget?
- jQuery AJAX call not executing in Plugin
- WordPress Plugin for One-Time Event Registration? [closed]
- How to use get_categories() with Event Organiser plugin
- Short code for Venues
- How to load default scripts included with WordPress correctly?
- Get image URL from media library in input
- Ajax with jQuery UI dialog not working
- jQuery Plugin to use WordPress functions in AJAX request
- Pass a php string to a javascript variable
- Problem in loading javascript in footer
- Using jquery migrate for plugins incompatible with jquery 1.10.2
- How can I implement an Add to Collection function on my Image Gallery to be downloaded later?
- Best approach to fetch data from wp options to js file or php file
- Adding a slider captcha to the comment system
- How to put JQuery/Ajax inside shortcode?
- Plugin for a text modal box [closed]
- Can someone please tell me what is wrong with my plugin?
- Is there a way to set the default active tab on Post UI Tab pluggin?
- looking for navigation plugin (accordion) [closed]
- wordpress site | All-in-one-cufon IE Issue
- What plugin should I use for booking events and receiving payments? [closed]
- WordPress function not being called from jQuery method
- Ajax contact form widget plugin data not insert in database
- Time consuming callbacks in customizer
- Calling plugin function inside custom plugin for onclick event
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- How to prevent plugins from loading jQuery
- JQuery plugin that works with Google 1.10.2 and not with WordPress 1.10.2
- Loading a purchased jquery plugin in a wordpress theme
- Post Comments with Ajax in WordPress
- Integrating jQuery Datatables with Editor into wordpress admin
- Stop WordPress processing Javascript as text
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- wordpress add_action() issue in ajax call
- Localizing methods for jQuery append prepend wrap parent
- JQuery prepend a function
- Register google jquery gets overwritten by plugin
- Enqueue script: link not working in page source
- Custom meta box with jQuery.sortable custom post type list
- How to include my Ajax calls in one function instead of calling different ones every time?
- Load CSS files in header of Bones theme?
- Portfolio Slideshow Sliders Behaving Oddly When in jQuery Ui Tabs
- jQuery(‘#news-ticker’).cycle is not a function
- JS Plugin not executing the js correctly. Trying to make all internal links scroll smoothly
- Call javascript functions from each page
- Using AJAX to run SQL statement and populate dropdown
- Calendar for irregular recurring events [closed]
- WordPress slider that allows image, headline, text, and button?
- Adding a jQuery modal dialog to the admin area
- WordPress plugin isn’t loading completely
- Jquery POST Ajax Return null data in wordpress
- WordPress jQuery Post – Amending Variable Value Within Function Command
- Why do I need to reload the page for WordPress to see the new custom field added with jQuery
- Overriding inline !important CSS with Javscript code snippet with media query
- WP Ajax DB issues
- Ajax Call not Working in Plugin
- update_post_meta is not working for me when I use e.preventDefault for update button
- Website always load twice on start
- How To Remove “All, Publish, Draft and Expired” in Events Dashboard
- jQuery works instead of $
- checkout stripe with plugin contact form
- Uncaught TypeError: Cannot read property ‘cycle’ of undefined
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Overwriting Plugin’s Ajax callback function from theme
- Help with customising love it plugin (use within foreach)
- Can’t find variable is_single in my jQuery plugin
- How to install jquery dotdotdot plugin for WordPress?
- Specific plugin script not working on subdomain
- Javascript in plugin not working
- How to Add Jquery FullCalendar in wp plugin in admin
- Creating a comments voting system
- How to add jquery to my custom post type wp plugin
- What is the process for reimplementing a back up WordPress?
- Like/Dislike Bar not working when updating
- jquery-issue: cannot load the basic jquery
- Possible jquery / library conflict in plugin usage
- Ajax, jQuery and WordPress
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- Add jQuery in dashboard when is already added in main plugin page
- jQuery loaded in wrong order for non-admin page views only
- Why won’t the Comprehensive Google Map Plugin load?
- PHP and Jquery pass value from form. Update function on DataBase
- get_option include in my adsense
- How to use template field in the Event Organiser plugin widget
- How to resolve these findings from security audit
- Javascript as Jquery Function Call?
- JQuery UI plugin not working in IE7?
- Jquery based image accordian plugin
- wordpress jquery is not defined because the head tag is empty
- Change page content based on dropdown selection
- Ajax button “Load more” is not loading correct language version posts for logged out users
- How to write a plugin that “listens” every time, an edit occurs?
- How to add an active state class to my info box