jQueryUI draggable doesn’t work in WordPress plugin


I’m making a simple plugin in wordpress that shows a draggable element.Here is my code:

* @package jqcfc
Plugin Name: cfc jq

function page_jq() {
<!DOCTYPE html>

#draggable { width: 150px; height: 150px; padding: 0.5em; background:#eee;}
<script type="text/javascript">
$(function() {
$( "#draggable" ).draggable();
<div id = "draggable" class = "ui-widget-content">

function loadui() {
    wp_enqueue_script( 'jquery-ui-draggable', false, array( 'jquery' ));
    wp_enqueue_script( 'jquery-ui-droppable', false, array( 'jquery' ));

add_action( 'wp_enqueue_scripts', 'loadui' );
add_shortcode( 'jqpage', 'page_jq') ;

I load the short code jqpage in a wordpress page using elementor but dragging animation doesn’t work. Can anyone help me?

roma salah 4 months 0 Answers 11 views 0

Leave an answer