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

  • Home
  • SEARCH
  • 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 7070665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:35:38+00:00 2026-05-28T05:35:38+00:00

i have search but nothing came up to solve the problem i’m having, at

  • 0

i have search but nothing came up to solve the problem i’m having, at least none that i read and i read a lot. 🙂 my problem is that when someone goes to a url with a hash (ex: mysite.com/gallery/#image-name-1) i can make the class for it “current” so it shows as the clicked image but i can’t trigger the click function so that it will show the full size gallery image and information. my page is setup like with a big gallery image (pulls onclick and needs to pull by just the hash) and under it is a grid of thumbnails to click.

all help is appreciated. thanks in advance!!!

function gallery_grid()
{
    var gallery_url = document.location.toString();

    if(gallery_url.match('#'))
    {
        var gallery_anchor = '#' + gallery_url.split('#')[1];

        $('ul.gallery-grid li a[href="' + gallery_anchor + '"]').addClass('current');
        $('ul.gallery-grid li a[href="' + gallery_anchor + '"]').trigger('click'); /* need this to trigger the click function so i can pull info from it for the bigger gallery image */
    }
    else
    {
        $('ul.gallery-grid li:first a').addClass('current');
    }

    $('ul.gallery-grid li a').click(function()
    {
        // stuff goes here to grab from $(this) but it can't cause it's not triggered
    });
}

  • 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-28T05:35:39+00:00Added an answer on May 28, 2026 at 5:35 am

    It looks like you’re trying to trigger the click before you’ve added the click handler to the element. Move the if statement underneath the click handler.

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

Sidebar

Related Questions

I have a (hopefully quite simple) Javascript problem. I've search but found nothing that
I did a lot search already but couldn't find a straight anwser. I have
I have tried to search for proper answers, but nothing helped me so far.
I have search the net and found nothing. Maybe someone here might have used
I have search through the web to figure this out but no luck. I
Are hashtables always faster than trees? Though Hashtables have O(1) search complexity but suppose
I have a search setup inside a div but for some reason cannot get
I have successfully increased the zIndex for edit,add,del and search options but alertmod is
I tried to search SO but couldn't find close answers. What I have is
I have found some posts related to search on XML but those were not

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.