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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:25:01+00:00 2026-06-15T00:25:01+00:00

I use jquery 1.3.2. I try to write simple jquery to the ajax cart

  • 0

I use jquery 1.3.2. I try to write simple jquery to the ajax cart implemented on my website.
There are functions ajaxCartOpenCart() – opens cart block (simply unhides it) and ajaxCartCloseCart().

I added simple code that after adding to the cart, unhides cart block, waits for 4 seconds and closes cart block.

ajaxCartOpenCart();
setTimeout(function() {
  ajaxCartCloseCart()
}, 4000);

The problem: I need to create a condition that says – if during this time of 4 sec. a mouse enters #cart-block, then don’t close it and wait until mouse leaves. Else count 4 sec and close cart.

Thank you very much for help.

  • 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-15T00:25:02+00:00Added an answer on June 15, 2026 at 12:25 am

    You can clear the timeout and then call the ajax function when the mouse leaves. Something like:

    var t = setTimeout(function () {
       // ...
    }, 4000);
    
    $('element').hover(function () {
      clearTimeout(t);
    }, function () {
      ajaxCartCloseCart();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to write a Jquery. Ajax in codeigniter. But it does not post
i try to use jquery .text() but not really work : Before <a id=group_name
I try to use the columnFilter add-on of jquery datatable but I couldn't make
Use jquery + php. Doing custom AJAX captcha. i.e user clicks on image, it
I use jQuery to do AJAX calls. But specialchars like ÆØÅ (danish letter) comes
I'm trying to write a simple search server, using Django with AJAX. The server
Im ready to start pulling my hair out here. Trying to use jquery ajax
My question is when I use jQuery ajax get, I am getting data at
I wrote some simple jQuery code to try and hide rows of an html
i try to use jquery's on()-Method in combination with hover(). I want that the

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.