[Frontend Snippets] Make price widget draggable on touch devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make price widget draggable on touch devices | |
*/ | |
add_action( 'wp_enqueue_scripts', 'load_touch_punch_js' , 35 ); | |
function load_touch_punch_js() { | |
global $version; | |
wp_enqueue_script( 'jquery-ui-widget' ); | |
wp_enqueue_script( 'jquery-ui-mouse' ); | |
wp_enqueue_script( 'jquery-ui-slider' ); | |
wp_register_script( 'woo-jquery-touch-punch', get_stylesheet_directory_uri() . "/js/jquery.ui.touch-punch.min.js", array('jquery'), $version, true ); | |
wp_enqueue_script( 'woo-jquery-touch-punch' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment