我是新編程的人,特別是jQuery。使用jQuery在Colorbox中不顯示專輯照片
我想使用ColorBox使用http://www.xdevsoftware.com/blog/post/Using-ColorBox-in-ASPNET.aspx中的示例顯示相冊中的照片照片的詳細信息存儲在數據庫中。
一切工作正常,像在DataList中顯示所選專輯的照片,問題是當我點擊一張照片而不是使用coloBox來顯示照片時,它會打開實際的照片。本地主機:3478/FPOS_v2 /上傳/ 08012011080.JPG
下面是在.aspx代碼:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="ColorBox/colorbox.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" />
<script src="ColorBox/jquery.colorbox.js" type="text/javascript" />
<script type="text/javascript">
$(document).ready(function() {
$("a[rel='example1']").colorbox();
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DataList runat="server" ID="dlColorBox"
RepeatColumns="3"
RepeatDirection="Horizontal">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl='<%# "~/uploads/"+Eval("OriginalFilePath") %>'
rel="example1"
Title='<%# Eval("FileName") %>'>
<asp:Image ID="Image1" runat="server"
ImageUrl='<%# "~/uploads/"+Eval("ThumbFilePath") %>'
Width="100"
Height="100"
BorderStyle="None" />
</asp:HyperLink>
</ItemTemplate>
</asp:DataList>
</div>
</form>
</body>
</html>
下面是vb.net代碼:
Imports SqlHelper
Imports System.Data
Partial Class colorBoxDisplay
Inherits System.Web.UI.Page
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
DAL.connectionstring = ConfigurationManager.ConnectionStrings("fpaConnectionString").ConnectionString
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
BuildDataSet()
End Sub
Private Sub BuildDataSet()
Dim dataset As DataSet
dataset = SqlHelper.ExecuteDataset(DAL.connectionstring, "fpa_SP_album_view_by_id_gridview", 34)
dlColorBox.DataSource = dataset
dlColorBox.DataBind()
End Sub
可能有人請告訴如何改正這個?或者能夠使用ColorBox在dlColorBox DataList中顯示照片?
所以它就像分組照片1例colorpowered.com/colorbox/core/example1/index.html所選專輯
我是新來的jQuery中顯示照片,以便你能請註明如何使這個通過改變代碼來工作,因爲我最近3天在互聯網上查看了不同的例子。
任何幫助,將不勝感激:)
感謝
properyly加載