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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:45:00+00:00 2026-05-26T05:45:00+00:00

Hi all I use a php script to pull the names of the products

  • 0

Hi all I use a php script to pull the names of the products from a mysql db and display them into a list, each list has 4 sub list elements that are displayed and hidden (toggled) via jquery. my issue is if i move my cursor from on product to the next then it starts opeing that products <li> elements before the other one has closed. Such to the effect that if i run my cursor up the list it looks like a slinky 😀

how can i tell the jquery to wait till all other toggles have finished before running the new one?

while($info = mysql_fetch_array( $result ))
    {
    $str .="
              <li id='mas".$info['name']."'><span>".$info['name']."</span>
              <ul id='sub".$info['name']."' class='sub' style='display:none'>
              <li><span>Scripts</span></li>
              <li><span>Questions</span></li>
              <li><span>Forum</span></li>
              <li><span>Tips and Tricks</span></li>
              </ul>
              </li>

              <script type='text/javascript'>   
              $('#mas".$info['name']."').hover(function () {
              $('#sub".$info['name']."').slideToggle('slow');
              });
              </script>

          ";
    }
    echo $str;
  • 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-26T05:45:00+00:00Added an answer on May 26, 2026 at 5:45 am

    You can chain commands for the toggle event, with one of the initial chain links being a function which closes all other toggled items, with a callback once finished to toggle the item your’re currently selecting.

    So basically:

    Hover over new toggle->run function to close all toggles, passing the currently selected toggle elements’ id, and skipping the close function for it->have callback function to open currently selected toggle when all others are closed

    However, I would suggest that users want a quick, responsive, interface so shouldnt have to wait too long before getting what they want/expect. I would either look at shortening the time the toggles take to open/close, simply close all other toggles immediately when hovering over a new one, or apply a different type of navigation effect.

    Also, see here for some ideas:

    Jquery Close/Open Multiple Toggles

    Incidentally, have you thought about using/re-purposing an accordian?

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

Sidebar

Related Questions

Ahoy all. I've got a contact form PHP script. I use it for multiple
In php I have a script, that I use mod_rewrite to redirect all calls
I am trying to use the data I have received from a php script,
Possible Duplicate: PHP Curl script to pull data from remote server every 10 minutes
I am trying to use to a loop to pull all rows from a
I need to use PHP to copy data from one MySQL database to another.
When i use php include to include a page in my website all the
How do I use the sha512 function for PHP? Can I replace all my
I have custom event that has several different subscribers who will all use the
I am using jQuery and JSON to pull data from a database. Each row

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.