This works for me locally in testing..
add_action('wp_enqueue_scripts','enq_menu_scripts_and_styles');
function enq_menu_scripts_and_styles() {
// UI Core, loads jQuery as a dependancy
wp_enqueue_script(
'uicore',
'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js',
array('jquery')
);
// UI Theme CSS
wp_enqueue_style( 'uicss', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-darkness/jquery-ui.css' );
// Selectmenu JS
wp_enqueue_script( 'uisel', 'http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/ui.selectmenu.js' );
// Selectmenu CSS
wp_enqueue_style( 'uicss2', 'http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/ui.selectmenu.css' );
}
add_action('wp_head','select_menu_test_code');
// Simple test code
function select_menu_test_code() {
// Simple no-conflict function
?>
<script type="text/javascript">
jQuery(function($){
// You can use $ here
$('select#cat').selectmenu();
});
</script>
<?php
}
It wouldn’t work for me when trying to use ui-core from WordPress, jQuery seems to be ok though. I used the same version of UI with the test code so it’s strange that the one included in WordPress didn’t work for me(i do have a plugin active that uses ui core, but disabling didn’t seem to help at all).
See if my above code works for you, and tweak as necessary if it does.. 🙂