views:

110

answers:

0

I've got 4 buttons using Jquery UI's "button" feature. 3 work flawlessly. the 4th does not seem to want to always apply the jquery ui hover class "ui-state-hover" when it is hovered. it does some of the time, but most of the time it only applies a "hover" class (i'm watching it in firebug) and that obviously doesn't match up w/ their css styles. does anyone have any idea what the heck could be causing the discrepancy?

EDIT: i think it is a conflict between UI button and Ajax Uploader. here is some trimmed down code that i am using.

$('.upload_img').button({
    icons: {
        primary: 'ui-icon-folder-open'
    },
    label: "Browse"
    })





   jQuery('.upload_img').each(function(){

    var button = jQuery(this);
    var ID = jQuery(this).attr('value');
    var container = jQuery(this).parent();

    //prevent the clicks from its default 'form submit' behavior
    $(this).click(function() {
    return false;
    });             

    new AjaxUpload( button, {
        action: ajaxurl,
        name: ID , // File upload name
        data: { // Additional data to send
            action: 'save_function',
            type: 'upload',
            _nonce: '<?php echo $nonce; ?>',
            key: ID },
        onSubmit: function(file , ext){
            this.disable(); // If you want to allow uploading only 1 file at time, you can disable upload button

        },
        onComplete: function(file, response) {
            this.enable(); // re-enable upload button

            if(response == 99){
                //alert(response);
                show_message(5); // failure
                t = setTimeout('fade_message()', 2000);
            }
            // If there was not an error
            else{   

                show_message(4); // success
                t = setTimeout('fade_message()', 2000);

                }
        }
    });




    });