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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:35:12+00:00 2026-05-24T19:35:12+00:00

im trying to create a shopping cart widget. idea is that theres a box

  • 0

im trying to create a shopping cart widget. idea is that theres a box that shows how many items u have in your cart and when u click it it expands and shows detailed wiev of cart contents.

i managed to make it open nicley, but problem occures when i want to close it back. this should happen with mouseout event but i cant make it work properly.

here is the html:

<div id="cart-wrapper" class="clearfix">
  <div id="cart">
    Cart 0 item(s) <img src="images/arrow-down.png" alt="cart">
  </div>
  <div id="cart-open">
    <ul>
      <li>Morbi</li>
      <li>Praesen</li>
      <li>Phasellus</li>
      <li>Pellentesque</li>
    </ul>
  </div>
</div>

so #cart-open is the one that is hidden/shown when needed. and by default has display:none applied

heres js:

$(function() {
   $('#cart').live('click', function(event) {
        $('#cart-open').css('display', 'block');
        $(this).css('border-bottom', 'none');
    });

   $('#cart-wrapper').live('mouseout', function (event) {
       $('#cart-open').css('display', 'none');
       $('#cart').css('border-bottom', '1px solid  #F0F0F0');
   })
});

so the problem is that when i click on the #cart box it opens nicely and shows #cart-open, but when i move mouse the mouseout event is triggered on the old size of #cart-wrapper which was the begging size of the #cart. is it possible to re validate the size of the wrapper after it size has been changed by its child?
Or maybe there is another way to accomplish the job. the idea is simple: hide that #cart open when i move mouse out of either #cart or #cart-open.

  • 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-24T19:35:13+00:00Added an answer on May 24, 2026 at 7:35 pm

    Have you tried “mouseleave” instead?

    Try this:

    $(function() {
        $("#cart-open").hide();
        $("#cart").live("click", function() {
            $("#cart-open").show();
            $(this).css("border-bottom", "none");
        });
    
        $("#cart-wrapper").live("mouseleave", function() {
            $("#cart-open").hide();
            $("#cart").css("border-bottom", "1px solid #F0F0F0");
        })
    });
    

    I have tested this only on FireFox, but it worked. I have also added an example here if you want to play http://jsfiddle.net/cWRWD/2/

    Hope that helps.

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

Sidebar

Related Questions

I'm trying to create a basic shopping cart, having an issue with the product
I am trying to create a simple program which displays a shopping cart list
I'm trying to implement PayPal on a completely custom shopping cart and have been
I am trying to create a shopping cart. I've created the add function, where
I am trying to create a magento shopping cart module but things arent working
Trying to create my first iPhone app that would play back audio. When I
Trying to create a small monitor application that displays current internet usage as percentage
I'm trying to modify a shopping cart (zencart) to do what I want, so
I am trying to create an XML schema representing an 'order' for a shopping
I'm trying to build a shopping cart. There's very simple class which creates a

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.