1

JS:

$(document).ready(function () {
    $('#demo2').click(function () {
        $.blockUI({
            css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                    '-webkit-border-radius': '10px',
                    '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
        });

        setTimeout($.unblockUI, 2000);
    });
}); 

I have searched on how to block the UI whenever the data is being processed, i want to block the UI, however, the code that I saw was on button click, I want to execute the block UI on selected index change..

4

1 回答 1

3

您想要 .change 而不是 .click。假设选择具有 id: 'demo2':

$(document).ready(function () {
    $('#demo2').change(function () {
        $.blockUI({
            css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                    '-webkit-border-radius': '10px',
                    '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
        });

        setTimeout($.unblockUI, 2000);
    });
}); 
于 2013-11-11T10:06:31.547 回答