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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:22:39+00:00 2026-06-10T00:22:39+00:00

I am replicating some functionality from Google Reader where a table of entries is

  • 0

I am replicating some functionality from Google Reader where a table of entries is generated with a star that allows a user to highlight certain rows. I also want the user to be able to click on the row to expand the entry. To expand the row, my jquery reads:

$(".action_row").click(function() {
    if( $(this).next().is(':hidden') ) {
        $(".detailed_row").hide();
        $(".selected-action").removeClass("selected-action");
        $("#current-action").removeAttr("id");
        $(this).next().toggle('fast').addClass("selected-action");
        $(this).addClass("selected-action").attr("id", "current-action");
    } else {
        $(".selected-action").removeClass("selected-action");
        $("#current-action").removeAttr("id");
        $(".detailed_row").hide();
    }
});

It’s not really important what happens during the click, just that clicking .action-row triggers an event.

But inside each action-row is a star:

$(".action-star").click(function() {    

    //Toggle the star through CSS
    $(this).toggleClass("star-checked");
    if ($(this).hasClass("star-checked")) {
        $(this).html("<i class='icon-star icon-large'></i>");
    } else {
        $(this).html("<i class='icon-star-empty icon-large'></i>");
    }               
});

If the user clicks on the star, I only want the star to be toggled. However, right now, when the star is clicked, it triggers both the star toggle and the action_row event.

How should I alter the code so that the action_row code isn’t used if the star is clicked?

  • 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-10T00:22:40+00:00Added an answer on June 10, 2026 at 12:22 am

    read about stopPropagation() and stopImmediatePropagation()

    It seems the event is bubbling up from the star to the action-row which is causing you undesired affects.

    jquery: stopPropagation vs stopImmediatePropagation

    $(".action-star").click(function(e) {    
        e.stopPropagation(); // <-- top stop events from bubbling up
        //Toggle the star through CSS
        $(this).toggleClass("star-checked");
        if ($(this).hasClass("star-checked")) {
            $(this).html("<i class='icon-star icon-large'></i>");
        } else {
            $(this).html("<i class='icon-star-empty icon-large'></i>");
        }               
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 slaves replicating from a master that has a 17GB index. I
I'm working on a site that's grown both in terms of user-base and functionality
I have built a user control (ctlToolbarEdit) that has some buttons on it -
I am working on replicating the load() function from MATLAB for use in a
I'd like to use a Mixin to always add some init functionality to my
I'm trying to write some JS replicating jQuery's fadeIn and fadeOut functions. Here's the
Has anyone had experience taking a full-fledged Java desktop application and replicating the functionality
I've run two experiments, some replicating the conditions of a previous set. I have
I am implementing some AJAX which requires JSON to be returned from the server
I'm converting some code from ASM to C++, the ASM simply looks like so:

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.