admin管理员组文章数量:1321815
I'm making a simple plugin in wordpress that shows a draggable element.Here is my code:
<?php
/**
* @package jqcfc
*/
/*
Plugin Name: cfc jq
*/
function page_jq() {
?>
<!DOCTYPE html>
<html>
<head>
<style>
#draggable { width: 150px; height: 150px; padding: 0.5em; background:#eee;}
</style>
<script type="text/javascript">
$(function() {
$( "#draggable" ).draggable();
});
</script>
</head>
<body>
<div id = "draggable" class = "ui-widget-content">
</div>
</body>
</html>
<?php
}
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?
本文标签: javascriptjQueryUI draggable doesn39t work in Wordpress plugin
版权声明:本文标题:javascript - jQueryUI draggable doesn't work in Wordpress plugin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742105848a2421015.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论