2012-03-06 96 views
1

我以前沒有使用過這個插件。什麼現在我得到的是:獲取'環球免稅店未定義'異常

附送腳本

<script src="@Url.Content("~/Content/Scripts/jquery-1.7.1.js")" type="text/javascript"></script> 
<script src="@Url.Content("~/Content/Scripts/themes/classic/galleria.classic.min.js")" type="text/javascript"></script> 

我引用galleria主題head標籤內。我已經檢查了JQueryGalleria腳本的可見性,使用Chrome web developer tools(並且簡單地呼叫$("body").text("jQuery works");以確保我自己Jquery工作)。

<script type="text/javascript"> 
    // $("body").text("jQuery works"); 
    $(document).ready(function() { 
      $("#gallery").galleria({ 
       width: 750, 
       height: 300, 
       clicknext: true 
      }); 
     } // function() { 
    ); // $(document).ready(
</script> 

CSHTML

<fieldset> 
    @* other things*@ 
    @if(Model.AttachedInformation.Count > 0) 
    { 
     <div id="gallery"> 
      @foreach(var path in Model.AttachedInformation) 
      { 
       <img src="@path" alt="" width="50" height="50" /> 
      } 
     </div> 
    } 
</fieldset> 

Two moment are unclear for now:可予保持div其然後風格用於通過gelleria一個fieldset內識別; Chrome給我的信息是Galleria is not defined

需要諮詢! 謝謝!

編輯

enter image description here

+0

它表明該廣場JavaScript文件沒有被包括在內。你確定這個網址對它是正確的嗎?打開元素資源管理器中的頭部並單擊URL以確保。 – Archer 2012-03-06 13:53:58

+0

看看我的編輯。 – lexeme 2012-03-06 14:23:39

回答

2

你只引用一個廣場的主題。您還需要參考(如果您尚未下載,請下載)Galleria核心。 http://galleria.io/download/

請務必在主題腳本之前參考Galleria。