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 6562017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:39:33+00:00 2026-05-25T13:39:33+00:00

I am working with an external JavaScript plugin that I can not edit and

  • 0

I am working with an external JavaScript plugin that I can not edit and works by click on the a list of thumbnail images.

For styling purpose I have had to wrap the images in an <a> with:

if(img.parent("a").length == 0){
    img.wrap('<a />');
}

Is there a way I can add a click for the <a> I have inserted which then makes this JavaScript plugin call the actions for click on a image.

I have tried this although doesn’t work and gives the error: Too much recursion:

$("#thumbs a").live("click", function(){
    $(this).find("img").click();
});
  • 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-25T13:39:34+00:00Added an answer on May 25, 2026 at 1:39 pm

    Yes.

    if(!img.parent("a").length){
        img.wrap('<a />').parent('a').bind('click', function() {
    
            // ALL THE CODE!!!
    
        });
    }
    

    You also don’t need to say if (something.length == 0) because it will return 0 by default…so you could say, if (!something.length)

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

Sidebar

Related Questions

I am working on a web page that pulls an external javascript file that
I'm working on an embedded C project that depends on some external HW. I
I have a widget-like block of HTML+JavaScript that people can copy/paste into their HTML-page
I have a flash player with an external javascript interface: reloadData() I'm calling that
Suppose you are working in a javascript project with several external library dependencies, and
I am working on an application in ASP.NET Development Server 10.0.0.0 that uses external
I'm working on a project where there is a lot of external service messaging.
I'm working on a Java 2D rendering program (running on 1.6.0_11), which uses external
Working with a SqlCommand in C# I've created a query that contains a IN
Working on a project that parses a log of events, and then updates a

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.