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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:57:54+00:00 2026-06-04T12:57:54+00:00

I am working with jQuery 1.7.2. I have create a custom plug-in that loads

  • 0

I am working with jQuery 1.7.2.

I have create a custom plug-in that loads a modal – i.e., a div with content. ($modal)

When the div is shown to the user, I would like to bind a function to all anchor tags in the div that has the class Close assigned to it.

I have something like this:

  $(".Close", $modal).die().on("click", hitMe());

The problem I am having is that every time the div loads, the hitMe() function is always firing. I only want this to fire when the user clicks an anchor in the div with class Close.

Any idea where I am going wrong with this?

  • 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-06-04T12:57:55+00:00Added an answer on June 4, 2026 at 12:57 pm

    You are calling hitMe inside the .on function.
    What you need to do is pass the function as an argument

    $(".Close", $modal).die().on("click", hitMe);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jQuery statement that's working fine. How would I re-write it in
I'm working with jquery. And i have text input in a form, i would
I'm working with Jquery in Drupal. I have sets of four blocks that all
I have a jquery/php voting system I'm working on. Once a user clicks a
I would like to create a gallery slideshow using Jquery Tools Scrollable plugin. But
I have to create an 'X' that pops up over the top right div
I am using jQuery to create custom radio buttons and i have a problem.
I'm working with jquery. I have an anchor tag that is generated dynamically in
I have a simple form that uses jQuery validation to notify the user of
So I don't have that much experience with js or jquery and I'm working

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.