【发布时间】:2012-03-06 13:50:10
【问题描述】:
我以前没用过那个插件。我现在得到的是:
包含的脚本
<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>
我在 head 标记内引用 galleria 主题。我已经使用Chrome web developer tools 检查了JQuery 和Galleria 脚本的可见性(并且只需调用$("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 保留在fieldset 中,然后将其样式化以供gelleria 识别吗? Chrome 给我的消息是 Galleria is not defined。
需要建议! 谢谢!
编辑
【问题讨论】:
-
这表明 Galleria javascript 文件没有被包含在内。你确定这个网址是正确的吗?在元素资源管理器中打开head并点击url进行确认。
标签: javascript jquery asp.net asp.net-mvc google-chrome