title: javascript repeat event function
body: <p>I try use this combination of function and repeat with setinterval , and add one unit in each time as i use in this script i create :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>        function rot(num) {
            var hide = num - 1;
            jQuery("#ss" + hide).hide(1000);
            jQuery("#ss" + num).show(1000);
            var_end = num + 1;
          }
          var ini = 1;
          setInterval(function() {
            if (end == "") {
              rot(ini);
            } else {
              rot(end);
            }
          }, 5000);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="ss1" style="display:none;"&gt;yy&lt;/div&gt;
  &lt;div id="ss2" style="display:none;"&gt;yy&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Each 5 seconds repeat and sen the number 1 for open div with number 1 and after this detect new number add 1 and hide until div and show the div with number 2 , i try many times but i don´t know why don´t want works , howewer don´t send value to function i don´t know </p>