3

Jquery UI で jquery fileupload プラグインを使用しています

https://github.com/blueimp/jQuery-File-Upload/wiki/Options

次のようなウィジェットオプションをオーバーライドしたいmaxUploadfilesize

メインファイルの設定を上書きする場合は現在 jquery.fileupload-ui.js

それからそれは動作します

var parentWidget = ($.blueimpFP || $.blueimp).fileupload;
    $.widget('blueimpUI.fileupload', parentWidget, {

        options: {
            // By default, files added to the widget are uploaded as soon
            // as the user clicks on the start buttons. To enable automatic
            // uploads, set the following option to true:
            autoUpload: true,
            //sequentialUploads, true,
            // The following option limits the number of files that are
            // allowed to be uploaded using this widget:
            maxNumberOfFiles: undefined,
            // The maximum allowed file size:
            maxFileSize: 20000000,
            // The minimum allowed file size:
            minFileSize: undefined,

HTMLテンプレートでそれをオーバーライドして、異なるHTMLページに対して異なるカスタマイズを行う方法はありますか?

デフォルト設定を上書きするテンプレートに入れることができるいくつかのjavavscriptコードを意味します

4

1 に答える 1

2

彼らのドキュメントには、あなたがそれらを上書きできると書かれています

プラグインを初期化する場所にこのコードを置くだけです

$('#fileupload').fileupload(
    'option',
    {
        maxFileSize: 4000000,
        sequentialUploads: true
    }
);
于 2012-12-10T04:09:11.960 に答える