title: How to change background-repeat and background-size by javascript
body: <p>I currently have this and it's working for me:</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;
              $(function () {
                  var body = $('body');
                  var backgrounds = [
                    'url(http://localhost:12448/css/images/back1.jpg) no-repeat',
                    'url(http://localhost:12448/css/images/back2.jpg) no-repeat'];
                  var current = 0;
  
                  function nextBackground() {
                      body.css(
                          'background',
                      backgrounds[current = ++current % backgrounds.length]);
  
                      setTimeout(nextBackground, 5000);
                  }
                  setTimeout(nextBackground, 5000);
                  body.css('background', backgrounds[0]);               
              });
  &lt;/script&gt;
  </code></pre>
  
  <p>I need to implement also this part of css code in to my javascript, so i can get dynamically changing background and the same css settings as it changes: </p>
  
  <pre><code>body
      {
          background-image:           url('images/overlay.png'),      url('images/bg.jpg');
          background-repeat:          repeat,                         no-repeat;
          background-size:            auto,                           100% 100%;
      }
  </code></pre>
  
  <p>Can anyone help me with this?</p>