我花了很多时间在上面搜索解决方案。
我收到一个错误,prettyPhoto() 不是函数。
从源头这个
我做过的事情:
页面上的链接:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<!-- Google Fonts -->
<link href='https://fonts.googleapis.com/css?family=Passion+One' rel='stylesheet' type='text/css' />
<link href='https://fonts.googleapis.com/css?family=Oxygen' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="../css/thumbnail-gallery.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery.MultiFile.js"></script>
<%--important--%>
<script type="text/javascript" src="../js/jquery.prettyPhoto.js"></script>
<%--important--%>
<script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script>
<%--important--%>
<script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
<%--important--%>
<link href="../css/prettyPhoto.css" rel="stylesheet" />
我的js函数是
<script type="text/javascript">
$(document).ready(function () {
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
图像绑定在数据列表上。
<div id="dvGalleryImages" align="center">
<asp:DataList ID="dlGallery" runat="server" RepeatColumns="4" RepeatDirection="Horizontal"
Width="100%">
<ItemTemplate>
<a href='<%# Eval("FilePath")%>' rel="prettyPhoto[pp_gal]" title='<%# Eval("Name") %>'>
<img src='<%# Eval("FilePath")%>' width="100" height="100" alt='<%# Eval("Name") %>' />
</a>
</ItemTemplate>
</asp:DataList>
</div>
请帮帮我。
JQuery 必须包含在任何 JQuery 插件之前(否则当它们运行时,它们就没有什么可插入的了)。
作为旁注,您还包括 2 个不同版本的 JQuery,这是无用的,并且会为您的用户增加下载时间,而收益为零。
你想重写你的包含:
<script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../js/jquery.MultiFile.js"></script>
<script type="text/javascript" src="../js/jquery.prettyPhoto.js"></script>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句