Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 999761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:24:18+00:00 2026-05-16T07:24:18+00:00

I have a single URL I am using as an image gallery. At this

  • 0

I have a single URL I am using as an image gallery. At this URL is a thumbs div (I’m only showing four thumbs for the sake of brevity):

 <div id="thumbs">
 <img src="graphics/thumbs/01.jpg" width="190" height="190" class="thumb objects" id="project01" />
 <img src="graphics/thumbs/08.jpg" width="190" height="190" class="thumb web" id="project08" />
 <img src="graphics/thumbs/14.jpg" width="190" height="190" class="thumb freehand" id="project14"/>
 <img src="graphics/thumbs/04.jpg" width="190" height="190" class="thumb freehand objects" id="project04" /></div>

And an empty div called #content:

<div id="content"></div>

and a hidden div called #preload:

 <div id="preload">
<span id="project01_content"><img src="graphics/010.jpg" /></span>
<span id="project02_content"><img src="graphics/022.jpg" /><img src="graphics/021.jpg" /><img src="graphics/023.jpg" /><img src="graphics/020.jpg" /></span>
<span id="project03_content"><img src="graphics/030.jpg" width="450" height="600" /><img src="graphics/031.jpg" width="450" height="600" /></span>
<span id="project04_content"><img src="graphics/040.jpg" width="775" height="600" /><img src="graphics/041.jpg" width="775" height="600" /></span></div>

My jQuery uses the ID of the clicked thumbnail to clone() the images from the corresponding span and drop them into #content using the html() method. It works great. Now, I’d like to return to mysite.com/#project01 and have #content already filled with Project 01.

How can I give each image a hashed URL that will call up the same jQuery state?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:24:19+00:00Added an answer on May 16, 2026 at 7:24 am

    You can just perform a click on that thumb as soon as the page loads and your current code should execute, like this:

    $(function() {
      if(window.location.hash.indexOf('project') > -1)
        $(window.location.hash).click();
    });
    

    This uses the window.location.hash property which would be "#project01" in your example URL…so it’s already an #ID selector, we’re just checking that it’s a hash we care about, then using that selector to fire a .click(). Just make sure this runs after your current click handler for the thumbs is bound.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a single xml document (data.xml), which I display as HTML using an
I have a single image file in a folder in my Eclipse project that
I have a single XML file that I want to index using Lucene.NET. The
I have built a single page application using backbone js. I have separate backbone
I am using Single Table Inheritance and have comments on all the subclasses. I
I have a navigation bar/list that is using only HTML and CSS. The background
I have several links that points to a single AJAX url. I can load
I have an array currently paginated by using URL parameters (eg. ....php?page=2&blah=blop&glob=gloo). At the
I am working on image gallery project using ASP.NET MVC3 and jQuery Cycle Plugin.
I have some operations that are inside blocks. This operations, only update an UIImage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.