JQuery ui buttons inconsistent freezing state

I have 4 buttons using the jQuery UI "button". 3 work flawlessly. the fourth doesn't seem to want to always use the jquery ui hover class "u-state-hover" when it freezes. it does some time, but most of the time it only applies the "hover" class (I look at it in firebug), and this clearly does not match the css styles. Does anyone know what could be causing the mismatch?

EDIT: I think this is a conflict between the user interface and Ajax Uploader. here is some stripped down code I'm 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);

                }
        }
    });




    });
+5
source share
1 answer

.button .upload_img ?

0

All Articles