This project is read-only.

JQuery not messing with image gallery correctly

Topics: Developer Forum, Project Management Forum, User Forum
Nov 11, 2008 at 7:30 PM
<%@ Page Language="C#" MasterPageFile="~/Templates/UI/Layouts/ThreeColumn.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="PaulKnopf.dashCommerce.Designer.Templates.UI.Views.ImageGallery" %>
<asp:Content ID="c" ContentPlaceHolderID="PageSpecificContent" runat="server">

    <div id="thumbnails">    
        <n2:ItemDataSource id="idsImages" runat="server" />
        <asp:Repeater runat="server" DataSourceID="idsImages">
                <a id="t<%# Eval("ID") %>" href='<%# Eval("ResizedImageUrl") %>' class="thumbnail">
                    <img alt='<%# Eval("Title") %>' src='<%# Eval("ThumbnailImageUrl") %>' />
                <div class="text">
                    <h2><%# Eval("Title") %></h2>
                    <%# Eval("Text") %>
    <div id="preview">

        <script type="text/javascript">
            $(document).ready(function() {
                var show = function() {
                    $(".selected", "#thumbnails").removeClass("selected");
                    $("#preview").html($(this).addClass("selected").next().children().clone()).prepend("<img src='" + this.href + "'/>");

                    return false;
                $(".thumbnail").click(show).filter(location.hash || "*").slice(0, 1).each(show);

The page is doing a N2.Resources.Register.JQuery(this) and is JQuery is in the loaded page correctly. The slideout menu still works.

Each image is displayed as block elements. The image's title is also underneath each image.

So for 2 images, I get one row with image, next row with title, next row with image, and next row for that images title.

Each image does succesfully render the image and title into the #preview when clicked. The hover effect for the small images is also not working.

What do you think is the problem?

Nov 11, 2008 at 8:07 PM
Does it work like this even if the images are cached locally? What browser are you using?
Nov 11, 2008 at 8:10 PM
Spoke too soon. Missing those css styles. Sorry.