之前我没有使用过这个插件。我现在得到的是:
包含的脚本
<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
主题。我使用JQuery
检查了Galleria
和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
。
需要建议! 谢谢!
编辑
答案 0 :(得分:2)
您只参考了Galleria主题。您还需要参考(并下载,如果您还没有)Galleria核心。 http://galleria.io/download/
确保在主题脚本之前引用Galleria。