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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:37:47+00:00 2026-05-24T08:37:47+00:00

I have these set of code from a helper: $(document).ready(function(expanded) { var listItems =

  • 0

I have these set of code from a helper:

$(document).ready(function(expanded) {
    var listItems = $('li.playerContainer');
    listItems.data("collapsed", true);
    $(listItems).click(function() {
        reset(this);
        var collapsed = $(this).data("collapsed");
        if (collapsed) {
            $(this).stop(true, true).animate({
                width: "450px",
                height: "500px"
            }).data("collapsed", false);
            $(this).children(".playerInfoR").addClass("rightAppear");
            $(this).children(".player_nameR").css({visibility:"hidden"});
            $(this).children(".closeR").addClass("rightAppear");
            $(this).children(".playerAchievesR").addClass("rightAppear");
        } else {
            $(this).stop(true, true).animate({
                width: "210px",
                height: "100px"
            }).data("collapsed", true);
            $(this).children(".playerInfoR").removeClass("rightAppear");
            $(this).children(".player_nameR").css({visibility:"visible"});
            $(this).children(".closeR").removeClass("rightAppear");
            $(this).children(".playerAchievesR").removeClass("rightAppear");
        };

        return false;
    });

    function reset(clicked) {
        $(listItems).not(clicked).stop(true, true).animate({
            width: "210px",
            height: "100px"
        }).data("collapsed", true);
        $(".playerInfoR").removeClass("rightAppear");
        $(".player_nameR").css({visibility:"visible"});
        $(".closeR").removeClass("rightAppear");
        $(".playerAchievesR").removeClass("rightAppear");
        return false;
    };

    $(".events").click(function(){

        $("events").load("http://www.yahoo.com");

    });

});

What it does is, between “li” items, click one to expand with the “width and height”, and click again to reset it back to default.

now I want to add another button inside the “li” to click on and load a div in another page. Unfortunately, every time I click that button, it acted like I just only clicked onto the “li” itself, so it just gave the effect, and the button won’t work even if I just want to click and get to another site. What can I do to make it clickable by itself.

Check on the Site please >>> SiteTest

  • 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-24T08:37:48+00:00Added an answer on May 24, 2026 at 8:37 am

    The click on the button will bubble up to the li you need to call event.stopPropagation() if you want to prevent the li from expanding, or I think you could check and see if the element clicked was actually the li by checking event.target.

    Halting event bubbling:

    $('.events').click(function(e){
       e.stopPropagation();
       // if you are using <a> tags for this you probably also
       // want to do e.preventDefault();
    
       $("#events").load("http://www.yahoo.com");
       return false;
    
    });
    

    Checking the element:

    $(listItems).click(function(e) {
      if($(e.target).is(this)){
        // do your normal expand collapse stuff
      }
      return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I have a set of checkboxes that are dynamically created from view data
I have written some code using jQuery to use Ajax to get data from
I have these lines in my ~/.inputrc : set editing-mode vi set keymap vi
I have set of points which lies on the image. These set of points
I have a set of five boolean values. If more than one of these
Say you have a string 3.4564. A sample set in the database has these
I have a set of unique elements (there are not two identical elements). And
Is there a way that you can have SERVEROUTPUT set to ON in sqlplus
Is there an easy way to have the form helpers set the tabindex parameter
I have a set of base filenames, for each name 'f' there are exactly

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.