Long contextual help needs two clicks to close
Long contextual help needs two clicks to close
Long contextual help needs two clicks to close
I just had to wrap document ready function around: jQuery(document).ready(function( $ ) { $(‘#imageholder img’).on(‘mousemove’, null, [jQuery(‘#horizontal’), jQuery(‘#vertical’)],function(e){ e.data[1].css(‘left’, e.offsetX==undefined?e.originalEvent.layerX:e.offsetX); e.data[0].css(‘top’, e.offsetY==undefined?e.originalEvent.layerY:e.offsetY); }); $(‘#imageholder’).on(‘mouseenter’, null, [jQuery(‘#horizontal’), jQuery(‘#vertical’)], function(e){ e.data[0].show(); e.data[1].show(); }).on(‘mouseleave’, null, [jQuery(‘#horizontal’), jQuery(‘#vertical’)], function(e){ e.data[0].hide(); e.data[1].hide(); }); });
WordPress uses jQuery (and others) in noConflict mode, meaning that $ isn’t automatically available. To use $ in your jQuery script, wrap your code in this: jQuery( document ).ready( function( $ ) { // $() will work as an alias for jQuery() inside of this function // [ your code goes here ] } ); … Read more
Theme JQuery inlcusion on WordPress 6.0 always fails
How to remove jquery migrate on selected posts
ahh nvm, sorted it: jQuery(document).ready(function($){ $(‘.addtocart’).submit(function(){ var data = {action: ‘my_special_action’,post:$(‘.addtocart’).serialize() }; $.post(“<?php echo admin_url(‘admin-ajax.php’); ?>”, data, function(response){ $(“.eshopajax”).insertAfter(this).fadeIn(100).html(response).fadeOut(3000); setTimeout (clearCart,200); setTimeout (doRequest,500); setTimeout (clearRequest,3000); }); function doRequest(){ var tdata = {action: ‘my_cart’}; $.post(“<?php echo admin_url(‘admin-ajax.php’); ?>”, tdata, function(response){ $(“.ajaxcart”).insertAfter(this).fadeIn(100).html(response); }); } function clearRequest(){ $(“.eshopajax”).empty(); } function clearCart(){ $(“.ajaxcart”).insert(); } return false; }); });
Trim your above code down to.. <?php wp_enqueue_script( “my_script”, plugins_url( ‘/your-script-name.js’, __FILE__ ), array( ‘jquery’ ) ); ?> <?php wp_head(); ?> <?php woo_head(); ?> Place your jQuery into a JS file, then enqueue it with jQuery as a dependancy(as above), this will ensure jQuery is loaded before your script is. Your script also needs to … Read more
I fixed it by including the JS files in the header, so there’s an error in another plugin’s JS that’s causing the issue.
I’m not good at this, but it could be because Cufon is not included in WordPress? So, you are deregistrating a script that is not included.. http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Default_scripts_included_with_WordPress
You won’t be able to do it purely with Javascript (with or without jQuery) as the images are hosted server-side, and there’d be no way for a Javascript function to scan to see what’s available. What you could do is write a function to do it in functions.php and tie it to a shortcode, but … Read more