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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:33:09+00:00 2026-06-17T05:33:09+00:00

By restarting i mean reset it so that it will restart the time, so

  • 0

By restarting i mean reset it so that it will restart the time, so that it takes 3 seconds from the restart.

My code is:

/* ********** Forside Slider ********** */

var slider_current_id = 1;

$(".slidermenu").live("click", function() {
    var id = $(this).attr('data-id');
    clearInterval(window.slider_timer);
    window.slider_timer = setInterval(start_slider_timer(), 3000);
    window.slider_current_id = parseInt(id, 10);
    $('.slidermenu.currentone').animate({backgroundColor: '#FCFBFB'}, 'slow');
    $('.slidermenu.currentone').removeClass("currentone");
    $(this).animate({backgroundColor: '#f3f3f3'}, 'slow');
    $(this).addClass("currentone");
    $('#activeimage img.currentone').fadeOut('slow');
    $('#activeimage img.currentone').removeClass("currentone");
    $('#activeimage img[data-id='+id+']').fadeIn('slow');
    $('#activeimage img[data-id='+id+']').addClass("currentone");
});

function start_slider_timer() {
    if (window.slider_current_id == 5) {
        window.slider_current_id = 1;
    }else{
        window.slider_current_id = window.slider_current_id + 1;
    }
    $('.slidermenu.currentone').animate({backgroundColor: '#FCFBFB'}, 'slow');
    $('.slidermenu.currentone').removeClass("currentone");
    $('.slidermenu[data-id='+window.slider_current_id+']').animate({backgroundColor: '#f3f3f3'}, 'slow');
    $('.slidermenu[data-id='+window.slider_current_id+']').addClass("currentone");
    $('#activeimage img.currentone').fadeOut('slow');
    $('#activeimage img.currentone').removeClass("currentone");
    $('#activeimage img[data-id='+window.slider_current_id+']').fadeIn('slow');
    $('#activeimage img[data-id='+window.slider_current_id+']').addClass("currentone");
}

var slider_timer = setInterval(start_slider_timer(), 3000);

I dont get any errors, it just doesn’t run.. It is my Interval which doesn’t run at all.

Hope someone can help me solve this.

  • 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-17T05:33:10+00:00Added an answer on June 17, 2026 at 5:33 am

    Remove the parenthesis to provide the function as parameter instead of calling it. Replace

    var slider_timer = setInterval(start_slider_timer(), 3000);
    

    with

    var slider_timer = setInterval(start_slider_timer, 3000);
    

    Note that if you want to “restart” the timer, you first have to clear it with

    clearInterval(slider_timer);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting a mysterious error from time to time that I just don't
I have a script that I mean to be run from cron that ensures
I want to prevent my activity from restarting when I change the orientation from
I want to edit .vimrc file from Vim and apply them without restarting Vim.
I want to prevent my application from restarting when orientation of device changes. I
Is there a way to restart a ColdFusion application without restarting the entire server?
I'm creating a library that includes both Clojure and Java code, and would like
How can I define the environment when restarting a Rails app from the command
I'm using this technique to restart the game. Here is the code: function restart(e:MouseEvent)
$ sudo /etc/init.d/apache2 restart * Restarting web server apache2 ... waiting . ...done. username@servername

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.