2013-03-17 88 views
3

我試圖實現一個jQuery功能上傳文件在網站上。腳本使用'plupload'。jQuery的不傳遞功能

不幸的是在後臺運行的其他的jQuery fonction。

<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({ 
    // ... 
}); 

請有人可以幫我這個嗎?我收到以下錯誤控制檯:

Uncaught TypeError: Object [object Object] has no method 'pajinate' jScript.js:134

Uncaught TypeError: Object function (a,b){return new d.fn.init(a,b,g)} has no method 'supersized' jquery.min.js:16

+2

你得到任何錯誤....檢查控制檯....如果是,那麼它張貼在這裏...這將是helptful找出問題 – bipen 2013-03-17 17:10:36

+1

是什麼'$ .supersized '? – Mathletics 2013-03-17 17:17:13

+0

這是一個幻燈片。查看更多在這裏:http://buildinternet.com/project/supersized/slideshow/3.2/demo.html – tomprouvost 2013-03-17 17:18:30

回答

0

查看插件..there是與此相關的插件js/supersized.3.2.6.min.jstheme/supersized.shutter.min.js ...看起來像你缺少這些文件之一的兩個主要文件。加載它的jquery.js後<head>,它應該工作..

+0

這兩個腳本都加載在標題中,這一點毫無疑問。我的問題是關於這兩個腳本不能同時加載或類似的東西.. – tomprouvost 2013-03-17 17:27:53

+0

'不能被加載'我認爲這不應該發生,如果你是一個接一個地調用它... ... 。查看sorce並點擊鏈接..它應該顯示你的文件的內容..只是爲了確保..你給的路徑是正確的 – bipen 2013-03-17 17:31:50

+0

我有檢查。沒有問題。證明是,如果我刪除超大部分,上傳插件的作品。 – tomprouvost 2013-03-17 17:37:01

0

我發現在我的問題是,感謝大家!

的問題是,我有2個版本的jQuery裝載機。我刪除了舊版本,它的工作原理!

感謝所有