Jquery plugins 使用jQuery时出错';s Fancybox插件
我试图使用jQuery的fancybox插件在产品库中显示更大版本的缩略图。下面是视图中的代码Jquery plugins 使用jQuery时出错';s Fancybox插件,jquery-plugins,fancybox,Jquery Plugins,Fancybox,我试图使用jQuery的fancybox插件在产品库中显示更大版本的缩略图。下面是视图中的代码 @model IEnumerable<AccessorizeForLess.ViewModels.DisplayProductsViewModel> @{ ViewBag.Title = "Products"; Layout = "~/Views/Shared/_Layout.cshtml"; } <link href="~/Content/Site.cs
@model IEnumerable<AccessorizeForLess.ViewModels.DisplayProductsViewModel>
@{
ViewBag.Title = "Products";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="~/Content/Site.css" rel="stylesheet" />
<link href="~/Content/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/jquery.fancybox.css?v=2.1.5" rel="stylesheet" />
<link href="~/Content/jquery.fancybox-buttons.css?v=1.0.5" rel="stylesheet" />
<link href="~/Content/jquery.fancybox-thumbs.css?v=1.0.7" rel="stylesheet" />
<h2>Products - Necklaces</h2>
<div id="update-message"></div>
<p class="button">
@Html.ActionLink("Create New", "Create")
</p>
@using (Html.BeginForm("AddToCart", "Orders", FormMethod.Post))
{
<div id="container">
<div class="scroll">
@foreach (var item in Model)
{
<div class="itemcontainer">
<table>
<tr>
<td id="@item.Id">
@Html.ActionLink(@item.Name, "Details", new { id = item.Id })
<br />
<div id="@item.Id"></div>
<div class="divPrice" id="@item.Price">@Html.DisplayFor(modelItem => item.Price)</div>
<div class="divImg"><a class="fancybox-thumbs" href="@item.Image.ImagePath" title="@item.Image.AltText" data-fancybox-group="thumb"><img src="@item.Image.ImagePath" alt="@item.Image.AltText" title="@item.Image.AltText" class="fancy" /></a></div>
<div> </div>
<div class="divQuantity">Quantity: @Html.TextBoxFor(modelItem => item.Quantity, new { @id = "quantity", @style = "width:50px;" })</div>
<div class="divAddToCart">
<p class="button">
@Html.ActionLink("Add to cart", "AddToCart", "Orders", new { id = item.Id }, "")
</p>
</div>
<div style="height:15px;"></div>
</td>
</tr>
</table>
</div>
}
<br />
</div>
</div>
}
@section scripts {
<script src="~/Scripts/jQuery-jScroll.js"></script>
<script src="~/Scripts/jquery.fancybox.js?v=2.1.5"></script>
<script src="~/Scripts/jquery.fancybox-thumbs.js?v=1.0.7"></script>
<script src="~/Scripts/jquery.fancybox-buttons.js?v=1.0.5"></script>
<script type="text/javascript">
$(function () {
$('.scroll').jscroll({
autoTrigger: false
});
$('.fancybox-thumbs').fancybox({
prevEffect: 'none',
nextEffect: 'none',
closeBtn: true,
arrows: false,
nextClick: false,
helpers: {
thumbs: {
width: 50,
height: 50
}
}
});
});
</script>
}
@model IEnumerable
数量:@Html.TextBoxFor(modelItem=>item.Quantity,新的{@id=“Quantity”,@style=“width:50px;”)
}
@节脚本{
$(函数(){
$('.scroll').jscroll({
自动触发:错误
});
$('.fancybox拇指')。fancybox({
效果:“无”,
下一个效果:“无”,
是的,
箭头:错,
下一步单击:false,
助手:{
拇指:{
宽度:50,
身高:50
}
}
});
});
}
}
当我加载它时,我会得到一系列错误,它们如下所示:
未捕获的TypeError:无法读取未定义的属性“msie”
jquery.fancybox thumbs.js:22未捕获类型错误:无法设置属性
未定义jquery.fancybox buttons.js的“拇指”:20未捕获
TypeError:无法设置未定义索引的属性“按钮”:399
未捕获的TypeError:$(…)。fancybox不是函数
我更新到最新版本,它似乎解决了我遇到的错误我更新到最新版本,它似乎解决了我遇到的错误