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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:02:53+00:00 2026-05-27T16:02:53+00:00

I have two parts of scripts. Part 1 : $(mySelector).click(function() { alert(‘you call me’);

  • 0

I have two parts of scripts.


Part 1 :
$("mySelector").click(function() {
     alert('you call me');
})

Part 2 :
$("mySelector").click(function() {
     if(myCondition) {
          //how can i prevent calling the first function from here ???
     }
})

The whole problem, is that i have no access to part1. So i need to unbind the event allready specified in part 1, if myCondition is true, but otherwise i need to call the first function.

Thanks

UPDATE:

Thank you. I didn’t know about stopImmediatePropagation(). But i feel, that there must be something like that 🙂

But actually in my case it doesn’t work 🙁

Please have a look at my site
http://www.tours.am/en/outgoing/tours/%D5%80%D5%B6%D5%A4%D5%AF%D5%A1%D5%BD%D5%BF%D5%A1%D5%B6/Park-Hyatt-Goa/

Under the hotel description tab i have cloud carousel, when i click on not active image (not the front image), as you can see i’m consoling that i stopImmediatePropagation() there, but the event however calls 🙁

  • 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-27T16:02:54+00:00Added an answer on May 27, 2026 at 4:02 pm

    No access:

    $("#mySelector").click(function() {
         alert('you call me');
    })
    

    Access:

    var myCondition = true, //try false too
        fFirstFunction = $("#mySelector").data("events").click[0].handler;
    $("#mySelector").unbind("click");
    $("#mySelector").click(function() {
        if(myCondition) {
            alert(myCondition);
        } else {
            $("#mySelector").click(fFirstFunction);
        }
    });
    

    Look at this example

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

Sidebar

Related Questions

Actually, this question seems to have two parts: How to implement pattern matching? How
I have a project in two parts: a Silverlight front end and a WCF
Background This question is in two parts. I have a one-way WCF operation hosted
The question has two parts, one of which I already have the answer for.
I have a HTML fragment which contains two anchor tags in various parts of
I have a two part question Best-Practice I have an algorithm that performs some
Let's say i have two tables in db: Car and Part. Car owns arbitrialy
I'm relatively new to Perl, writing some XML parsing scripts. I have done two
I have two Perl scripts that are supposed to do the following job: Server
I have a batch script that can display two or more colors of text

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.