I tested and works fine. but you can use the wp_footer
hook and you can add your custom js. check below code. code will go to the active theme functions.php file.
function add_custom_scripts(){ ?>
<script type="text/javascript">
(function($){
$(document).ready(function() {
$( '#menu-item-927' ).on( 'ubermenuopen', function(){
$('.site-content').addClass('blur');
});
});
})(jQuery);
</script>
<?php }
add_action( 'wp_footer', 'add_custom_scripts', 10, 1 );
Related Posts:
- Should I use .done() and .fail() for new jQuery AJAX code instead of success and error
- Pass request headers in a jQuery AJAX GET call
- jQuery set checkbox checked
- JavaScript Loading Screen while page loads
- How to make html table vertically scrollable
- How to Show External website inside another page without iFrame? [closed]
- How to get client’s IP address using JavaScript?
- Calling a user defined function in jQuery
- Run ScrollTop with offset of element by ID
- How to remove css property in jQuery
- Using jquery to get all checked checkboxes with a certain class name
- Validate form before submit jquery
- How to get a value of an element by name instead of ID
- jquery clear input default value
- How to manage ajax calls and JSON in wordpress
- Display Media Uploader in Own Plugin on WordPress 3.5
- How to add a ” waiting” icon for an ajax in WP frontend?
- Make jQuery library load before plugin files
- RequireJS in custom theme. Working Example
- How do I use WP’s jQuery
- call shortcode in javascript
- inject js after redirect
- Deregister WordPress jquery on specific page
- Fire jQuery function when post edit screen loads
- Add X meta box inputs based on form at top of meta box, how to do it right?
- wp_enqueuescript won’t load in footer even with true value set?
- Execution of JavaScript on save post
- modifying a template and adding jQuery to it
- Add colorpicker to featured image
- How do I pass WordPress’s get_bloginfo(‘siteurl’) to Jquery?
- How to force jQuery to load as a first script in header in frontend?
- jQuery breaking my wordpress site
- wp_verify_nonce not working
- Populating autocomplete field with custom post type
- Making the wordpress login form a jQuery dropdown
- Not sure why wp_ajax isn’t working?
- Load created php file data via ajax
- Is it necessary to enqueue jquery?
- How I got jQuery Quicksand working with WordPress?
- Displaying div from custom-post-type in Fancy Box
- NextGen plugin check failing, why?
- WordPress + BlockUI or a splash page [closed]
- Return an array from get_terms and store as JavaScript array for search autocomplete
- On screen music/audio player that grabs track URL [closed]
- WP http XML response HTML encoding and image display problems
- Using WP_Query to grab custom meta values, foreach to json object
- Do we have to santise html passing into Javascript ? How?
- Add/remove action on jQuery toggle
- jShowOff not showing numeric links, shows ‘undefined’ instead
- Javascript stopped working [closed]
- url – ajax loaded but no JS
- Why should I deregister jquery?
- Prevent other versions of jquery from loading on static front page
- jQuery does not work on WordPress editor
- How to add custon UI jquery & Fancybox script to WP
- jQuery will not work on page from snippet or file
- Jquery not loaded by default in wordpress 5.6
- How to keep HTML form field that is conditional hidden with javasript hidden after page reload?
- Accessing javascript in multiple files [closed]
- Loading jquery locally
- Issues loading Jquery on WordPress website
- Script not loading when depending on jQuery
- masonry only works if jquery is called twice
- No Object Properties sending form through AJAX
- Redirect wp_dropdown_pages() to an AJax request?
- click event to unhide something after ajax not firing
- how to use wp_editor() here am getting empty result
- Why does WordPress load jQuery in my header instead of footer?
- Parse wordpress blog data using json api and ajax
- JQuery Issues With WordPress Theme Interface
- problems with jquery external rss feed integration
- wp_enqueue_script calling jQuery at different times for different browsers?
- AJAX calendar navigation returns -1
- A carousel slideshow plugin in JavaScript
- Retrive username of the loged in user using jquery
- How to setup multi-page using jquery?
- jQuery Datepicker displays wrong language until interection with the calendar
- Theme customisation – how to store javascript externally when it utilises php variables?
- onclick jquery function not working in wordpress header file [duplicate]
- How can I add a new lib path without call each one on the header?
- Unable to remove jquery from header and put in before body ends
- Target WooCommerce submit button
- why does included jquery always cause problems
- jQuery infinite scroll and pagination styling in wordpress
- Is it necessary to use a WordPress nonce when allowing users to download public data?
- Jquery is not working in wordpress php file
- wp_signon not working fine and 302 moved temporarily?
- how to refresh index page without reloading browser using ajax
- How to move featured image to the top of the list?
- jQuery form plugin, submit in the wordpress way
- How jQuery Works in WordPress [duplicate]
- Delete wp_deregister_script(‘jquery’) returns an not shown error
- Using WP Ajax and jQuery to process multiple forms on the same page?
- jQuery cycle and WordPress: Captions, buttons, oh my
- CF7 Add a read only attribute to an input field
- How do I add Javascript and CSS files into WordPress?
- Why is jQuery not working properly? [closed]
- How to Javascript/jQuery
- slider wont load unless you scrolldown on mobile, slick.js carousel
- Can’t Get jQuery AutoComplete to work in WordPress (jQuery Hide/show works)