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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:32:24+00:00 2026-05-21T12:32:24+00:00

I have a experiment of image slideshow, where each image slides for every three

  • 0

I have a experiment of image slideshow, where each image slides for every three seconds. I have two buttons one is called "Pause bag" and other "Pass bag", and within that three seconds I need to click on "Pause bag" button. As I click on the "Pause bag" the image gets paused and when I click on "Pass bag" Slideshow resumes (another image is displayed on the screen).

My Problem is I need to record number of seconds for the paused image. As soon as I click on the "Pause bag" button, a function called btn_pause_click() is invoked, this function records the number of seconds for the image pause till the "Pass bag" is clicked. For the first click of "Pass bag" I’m getting the exact number of seconds for image pause, then slide show resumes and another image is seen on the screen. When I again click on it I’m getting more number of seconds then actual image pause. For suppose say, on the very first click of "Pass bag", image gets paused for 9.67 seconds, then after another image comes and for suppose say this image is paused for 6.75 seconds, so when I click on "pass bag" for this image I need to get 6.75. Instead I’m getting 9.67+6.75. Instead I need to record only 6.75. Appreciate any ideas on this..

Here are my functions for the "Pause bag" button Click and "Pass bag" Button Click:

function display_pause()
{
     if (milisec_pause>=99)
      {
         milisec_pause=0;
         seconds_pause+=1;
      }
      else
         milisec_pause+=1;
         dpause = seconds_pause + "." + milisec_pause;
         timer_pause = setTimeout("display_pause()",10);
         pause_Timer  = dpause;
}
 

function btn_pause_click()
{
    display_pause();
    document.myForm.btn_pause.disabled = true;
    document.myForm.btn1.disabled = false;
    document.myForm.btn_pass.disabled = false;
    clearTimeout(Timer);
    clearTimeout(msg_Timer);
}

function btn_pass_click()
{
    alert(pause_Timer);
    clearTimeout(pause_Timer);
    pause_Timer = 0;
    milisec_pause=0;
    seconds_pause=0;
    document.myForm.btn_pass.disabled = true;
    document.myForm.btn1.disabled = false;
    document.myForm.btn_pause.disabled = false;
    Timer = setTimeout("slideit()",800);
    if(flag == 1)
    msg_Timer = setTimeout("msg(flag)",500);
}
  • 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-21T12:32:25+00:00Added an answer on May 21, 2026 at 12:32 pm

    There seems to be something wrong here:

    1. timer_pause is your timer:

      timer_pause = setTimeout("display_pause()",10); 
      
    2. pause_Timer is the string with the current pause time in <sec>.<millisec>

      dpause = seconds_pause + "." + milisec_pause;
      //...
      pause_Timer  = dpause;
      

    But

    1. you’re clearing pause_Timer and not timer_pause which is the var for the timer

      clearTimeout(pause_Timer);
      
    2. and you’re also setting it pause_Timer to 0

      pause_Timer = 0;
      

    Not considering other issues (if any), you should at the least make this change:

    clearTimeout(timer_pause);
    

    Next, consider variable names that are more descriptive and less likely to be confused with each other!

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

Sidebar

Related Questions

I have a branch called experiment. git checkout master echo 'some changes' > a.txt
I have a function called: void initializeJSP(string Experiment) And in my MyJSP.h file I
Ok so part two of I have no will power experiment is: Summary Question
i have 3*3 pieces of images from one image(By Croping) but how to manage
A thought experiment: You have a CMS that allows users to upload an image,
I have an experiment streaming up 1Mb/s of numeric data which needs to be
I thought it would be a cool experiment to have a for loop and
I am new to Ember.js. I have the following experiment in my HTML: <p>Username:
I have a pet project with which I experiment with new features of C++11.
I want to experiment with an idea I have of automatically localizing software, or

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.