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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:40:34+00:00 2026-06-18T06:40:34+00:00

I have a strange issue with jQuery. I have a function, which gets executed

  • 0

I have a strange issue with jQuery.

I have a function, which gets executed on an event of a <a> tag.

link.click(someAction);

In the action, I modify another div-element, where I simply set a few CSS parameters and modify the classes.

This works as expected.

Now, I wanted to expand someAction with a bool parameter.
I figured that I could call the method now as followed:

link.click(function () {
    someAction(true);
});

Unfortunately, this does not work. I have no idea why.
The method gets called and everything, but the CSS & classes simply do not change.

Then again by calling exactly the same method with link.click(someAction); it works.

Can anyone tell me why?


Here’s some code

var openPopover = function( showOverlay ){
    if (typeof showOverlay === "undefined" || showOverlay === null) showOverlay = true;

    if (showOverlay) {
        // Add transparent overlay
        overlay.show();
}

    // Select popover next to the clicked item
    popover = $(this).next("div.popover");
    // It positioned underneath the clicked item, with the spacing above

    // Display the popover
    popover.show();

    // Reset classes
    popover.removeClass("hide-animation");
    popover.addClass("show-animation");

    var animationEnd = function() {         
        $(overlay).off("webkitTransitionEnd");
        $(overlay).off("oTransitionEnd");
        $(overlay).off("transitionend");
    };

    // Add animation did end observer
    $(overlay).on("webkitTransitionEnd", animationEnd);
    $(overlay).on("oTransitionEnd", animationEnd);
    $(overlay).on("transitionend", animationEnd);

    // Run animations
    popover.addClass("shown");
    overlay.addClass("shown");

    // If the browser doesn't support css3 animations, we call it manually
    if (!supportsCSSAnimations) {
        setTimeout(animationEnd, animationDuration);
    }
  };

  selectButton.hover(openPopover); // Opens the popover correctly

  selectButton.hover(function () {
    openPopover(true); // Doesn't work
  });
  • 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-18T06:40:36+00:00Added an answer on June 18, 2026 at 6:40 am

    After your changes:

    this in the following line, will point to window:

    popover = $(this).next("div.popover");
    

    whereas before, it pointed to selectButton. Try:

    selectButton.hover(function () {
      openPopover.call(this, true);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange issue with jQuery's hover, addClass $(document).ready(function(){ $('#selectable li').hover( function(){ $(this).addClass('selecting',
I have a strange issue in JQuery AJAX.. My Steps sequence are as follows:
I am facing a strange behaviour in jQuery 1.4 with the click event. The
I have a strange JQuery issue that I am looking for help with. I
I have a very strange issue with the jQuery Validation plugin where it won't
I have some strange issue using jQuery Validation plugin. Firs of all here is
I am currently stumped on a strange issue. I have a jQuery slider that
I have a very strange issue with JQuery, its about a starting of JQuery
I seem to be having a strange jQuery issue. On my page I have
I have a wierd issue with jQuery which I've never seen before. I have

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.