Articles of jquery ui

How to enable the content editor as a droppable target with jQuery-ui?

I’m trying to enable the WordPress content editor as a droppable using jQuery UI drag and drop. However, I can’t get the drag to drop, or the drop event to fire. Is there something I’m missing? <ul id=”keywords”> <li>drag one</li> <li>drag two</li> <li>drag three</li> </ul> jQuery(“#keywords”).find(“li”).each(function(){jQuery(this).draggable( { helper:’clone’, start: function(event, ui){ jQuery(this).fadeTo(‘fast’, 0.5);}, stop: function(event, […]

Automatic jQuery accordion from header tags

I want it to be fairly easy for the post author to setup an accordion, based on header tags. So for example this: <h3>Headline 1</h3> <p>Content.. lorem ipsum</p> <h3>Headline 2</h3> <p>Content.. lorem ipsum</p> <h3>Headline 3</h3> <p>Content.. lorem ipsum</p> would be converted to this (and so, accordion is activated) <div class=”accordion”> <h3>Headline 1</h3> <div><p>Content.. lorem ipsum</p></div> […]

using wp_enqueue_script to attach jquery-ui

I am trying to load jquery-ui using wp_enqueue_script. I can check that jquery is loaded. jquery-ui is registered i.e. output of var_dump( wp_script_is( ‘jquery-ui-tabs’, ‘registered’ ) ); is bool(true) which indicates it is registered but it does not get included to the page. I am using wordpress version 3.3.1 What is going wrong? I am […]

Correct way to enqueue jquery-ui

I’m having a tough time including jquery-ui scripts and styles in my plugin. It seems that my wp_enqueue_script calls are simply ignored. There are already many questions similar to this one, but all answers I’ve found so far boil down to call wp_enqueue_script inside the wp_enqueue_scripts action hook, which I’m already doing. In the constructor […]

How do I use jQuery UI tabs in a WordPress page?

I want to use jQuery UI tabs in my WordPress 3.1.4 pages. I write programming tutorials for a VB .NET audience but like to provide C# source as well, and I want to use the tabs to let the readers switch between the two. I could probably make my own given time, but this was […]

Enqueue Javascript Correctly for 3.5

I am trying to create tabs for admin settings page in wp, but I think I’m doing it wrong. The example below shows how I did it but I don’t know how to change this to use it correctly with no conflict ie. $. function my_plugin_load_js() { wp_deregister_script(‘jquery’); wp_register_script(‘jquery’, ‘http://code.jquery.com/jquery-1.8.3.js’); wp_enqueue_script(‘jquery’); wp_deregister_script(‘jquery-ui-core’); wp_register_script(‘jquery-ui-core’, ‘http://code.jquery.com/ui/1.9.2/jquery-ui.js’); wp_enqueue_script(‘jquery-ui-core’); […]

Admin area 'toggle' w/ cookie

the wordpress admin already uses some kind of toggle on the menu and on metaboxes.. w/ “Click to Toggle” buttons that remember the open versus closed state. Does anybody know what code is responible for this? I’d like to implement it into sections of my custom metaboxs, and it doesn’t seem like I should need […]

Ajax with jQuery UI dialog not working

I am trying to update my custom database table when changes are made in a dialog box. The script for the dialog box and ajax call is as follows – jQuery(document).ready(function($){ $(“td > span”).click(function(){ var id = $(this).attr(‘id’); var message = “message”+id; var content = jQuery(“#”+message).text(); var $dialog = $(“<div></div>”).html(“<textarea style=’width:99%; height:90%’ class=’popup-content’>”+content+”</textarea>”).dialog({ height: 400, […]

Save list from a custom meta box?

I have a simple list (ul>li) which is manipulated with jQuery UI in a custom meta box. How would I go about saving the contents of the list during post save? I already have the save function ready, but how do I get the HTML data into PHP so I can put it in the […]

WordPress Iris Colour Picker adding iOS touch events

I’ve implemented an Iris Colour Picker into the front-end of my theme thanks to the help provided in this question and all works well on the desktop front. However, it seems as though when it comes to an iPad device the colour picker doesn’t work as expected. The mouse dragging event isn’t being recognised, however […]