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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:37:28+00:00 2026-06-08T06:37:28+00:00

I have a function which loops through rows in a table so that only

  • 0

I have a function which loops through rows in a table so that only one is shown at any given time.

I want to expand on this so that when I hover over the table, it shows all the rows, and then when I move away, it resumes showing one row at a time.

The Problem I have is that on hovering, the first function keeps going, is there a way to ‘pause’ the function. I’ve looked at various examples using ClearInterval(),but can’t match them to my script.

//Calling The function that loops through the rows    
function hideShow(time)
{   
    setInterval('showRows()',time); 
};      

//Set the time between each 'loop' and start looping 
$(document).ready(function()
{
    hideShow(2000);
}   
);

//The hover function to show / hide all the rows
$(document).ready(function()
{
    $('#dbTable1 tr').hover(function() 
        {
            $('.Group td').removeClass('RoundBottom');
            $('.Group').show();
        },  
        function()
        {
            $('.Group td').addClass('RoundBottom');
            $('.Group').hide();
        }
    ); 
}
);

Can anyone show me please how I can combine the two?

  • 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-08T06:37:29+00:00Added an answer on June 8, 2026 at 6:37 am

    You need to keep track of the timer ID when you call setInterval:

    var timerID;
    
    function hideShow(time){
      timerID = setInterval(showRows, time);
    }
    

    Then later on when you want to stop the repetition, call clearInterval and pass in that ID:

    // ...
      $('.Group td').removeClass('RoundBottom');
      $('.Group').show();
      clearInterval(timerID);
    },
    function()
    {
      hideShow(2000);
      $('.Group td').addClass('RoundBottom');
      // ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a for loop which loops through an array and want to match
I have a function that loops through different types of listings pulled from MySQL
i have 2 tables, i want to add rows from one table to another,
i have a function which retrieves values from a webservice , then loops through
I have an html table built from a database query which loops through and
I have a table of strings and want to retrieve all rows which contain
I have the following loop which is giving me problems $(#divResults).append('<table>'); $.each( results.d, function(
I have a function that checks each cell in each row of a table
I have a for loop which loops through an array of results from a
I have a page which loops through multiple unique id's and, using ajax, loads

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.