Note that there are some explanatory texts on larger screens.

plurals
  1. PORestarting the Interval Timer?
    primarykey
    data
    text
    <p>By <code>restarting</code> i mean reset it so that it will restart the time, so that it takes 3 seconds from the restart.</p> <p>My code is:</p> <pre><code>/* ********** 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); </code></pre> <p>I dont get any errors, it just doesn't run.. It is my <code>Interval</code> which doesn't run at all.</p> <p>Hope someone can help me solve this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload