3

Web サイトにファイルをアップロードする jQuery 関数を実装しようとしています。スクリプトは「plupload」を使用します。

残念ながら、バックグラウンドで実行されている他の jQuery 関数があります。

<script type="text/javascript">
    jQuery(function ($) {
        $.supersized({
            // Functionality
            slide_interval: ss_interval, // Length between transitions
            transition: 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left or ss_transitionType
            transition_speed: ss_transitionSpeed, // Speed of transition
            // Slides   
            slides: [ // Slideshow Images
            {
                image: 'images/gallery/1.jpg',
                title: 'Upload and share your music with other...',
                title2: 'Music'
            }, {
                image: 'images/gallery/2.jpg',
                title: 'Share your work online and access your documents from anywhere. ',
                title2: 'Documents'
            }, {
                image: 'images/gallery/3.jpg',
                title: 'Show off your favorite photos and videos to the world.',
                title2: 'Photography'
            }, {
                image: 'images/gallery/4.jpg',
                title: 'Let the world watch your videos, or share them privately.',
                title2: 'Video'
            }, {
                image: 'images/gallery/8.jpg',
                title: 'Free file storage service. Share files with your friends.',
                title2: 'Upload and Share'
            }]
        });
        $("#uploader").plupload({
            // General settings
            runtimes: 'flash,html5,browserplus,silverlight,gears,html4',
            url: 'upload.php',
            max_file_size: '1000mb',
            max_file_count: 20, // user can add no more then 20 files at a time
            chunk_size: '1mb',
            unique_names: true,
            multiple_queues: true,
            // Resize images on clientside if we can
            resize: {
                width: 320,
                height: 240,
                quality: 90
            },
            // Rename files by clicking on their titles
            rename: true,
            // Sort files
            sortable: true,
            // Specify what files to browse for
            filters: [{
                title: "Image files",
                extensions: "jpg,gif,png"
            }, {
                title: "Zip files",
                extensions: "zip,avi"
            }],
            // Flash settings
            flash_swf_url: 'js/upload/plupload.flash.swf',
            // Silverlight settings
            silverlight_xap_url: 'js/upload/plupload.silverlight.xap'
        });
        // Client side form validation
        $('form').submit(function (e) {
            var uploader = $('#uploader').plupload('getUploader');
            // Files in queue upload them first
            if (uploader.files.length > 0) {
                // When all files are uploaded submit form
                uploader.bind('StateChanged', function () {
                    if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {
                        $('form')[0].submit();
                    }
                });
                uploader.start();
            } else alert('You must at least upload one file.');
            return false;
        });
    });
</script>

問題は次のとおりです。何も機能せず、ページは何も返しません。しかし、この部分を削除すると (以下を参照)、アップロードの機能が動作します:

$.supersized({
    // ...
});

誰かがこれを手伝ってくれますか?コンソールに次のエラーが表示されます。

キャッチされていない TypeError: オブジェクト [オブジェクト オブジェクト] にはメソッド 'pajinate' がありません jScript.js:134

キャッチされていない TypeError: オブジェクト関数 (a,b){return new d.fn.init(a,b,g)} にはメソッド「スーパーサイズ」がありません jquery.min.js:16

4

2 に答える 2

0

プラグインを表示すると、このプラグインに関連する 2 つの主要なファイルがjs/supersized.3.2.6.min.jsあり、theme/supersized.shutter.min.js... これらのファイルの 1 つが欠けているようです。<head>jquery.jsの後にロードすると、動作するはずです..

于 2013-03-17T17:24:40.020 に答える
0

皆さんのおかげで、私の問題がどこにあるかを発見しました!

問題は、2 つのバージョンの jquery loader があったことです。古いバージョンを削除しましたが、動作します!

皆さんありがとう

于 2013-03-17T18:01:18.483 に答える