Adding jQuery Multiselect to a custom plugin
-
Hi everyone.
I’m developing a small plugin, where jQuery Multiselect (https://quasipartikel.at/multiselect) would come very handy.I want to install in on one of option pages in administration
Following the instalation tips (https://quasipartikel.at/2009/05/10/jqueryui-multiselect/) i wrote:
Instead of:
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.7.1.custom.min.js"></script> <script type="text/javascript" src="js/ui.multiselect.js"></script>
i wrote:
function multiselect() { wp_enqueue_script('jquery', 'https://www.8ball.lu/wp-content/plugins/billiards-manager/styles/jquery-1.3.2.min.js'); wp_enqueue_script('jquery-ui', 'https://www.8ball.lu/wp-content/plugins/billiards-manager/styles/jquery-ui-1.7.3.custom.min.js'); wp_enqueue_script('jquery-ui-multiselect', 'https://www.8ball.lu/wp-content/plugins/billiards-manager/styles/ui.multiselect.js'); wp_enqueue_style('jquery-ui-custom', 'https://www.8ball.lu/wp-content/plugins/billiards-manager/styles/jquery-ui-1.7.1.custom.css'); } add_action('init', 'multiselect');
and also added the required javascript
<script type="text/javascript"> $(function(){ // choose either the full version $(".multiselect").multiselect(); // or disable some features $(".multiselect").multiselect({sortable: false, searchable: false}); }); </script>
But nothing works. Scripts are not loaded in the header (I checked sourcecode).
In fact, I want this jquery Multiselect to work only in one of the functions. What do I do wrongly here?Thank you
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Adding jQuery Multiselect to a custom plugin’ is closed to new replies.