2011-02-02 24 views
0

特にjQueryを初めて習得しました。jQueryを使用してアルバムボックスの写真がColorboxに表示されない

http://www.xdevsoftware.com/blog/post/Using-ColorBox-in-ASPNET.aspxの例を使用してアルバムから写真を表示するために、ColorBoxを使用しようとしています。写真の詳細は、DBから保存され、取得されます。

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内の写真を表示できるようにするにはどうすればよいですか?

だから、私はjQueryのに新しいです

colorpowered.com/colorbox/core/example1/index.htmlグループ化された写真1つの例のように、選択したアルバム内の写真が表示されますので、あなたはこれを作る方法を明記してください可能性がありますインターネット上のさまざまな例を見て、私が最後の3日間過ごしたように、コードを変更して作業してください。

すべてのヘルプははるかに高く評価されるだろう:)

おかげ

答えて

1

カラーボックスのjavascriptとcssファイルを確認してくださいproperylyロード。あなたのページのhtml出力をチェックしてください。

関連する問題