title: Changing background opacity of div using RGBa
body: <p>I am trying to change the background opacity of a div using a jquery ui slider.</p>
  
  <p>The user can change the background color of the div, so I need to know how I can only change the alpha parameter of the background without changing the color.</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>$('#opacity-slider').slider({ min: 0, max: 1, step: 0.1, value: 1 })
                  .bind("slidechange", function() {
                      //get the value of the slider with this call
                      var o = $(this).slider('value');
  
                      var e = $('.element-active');
              var currentColor = $('.element-active').css('background-color');        
                      $(e).css('background-color', 'rgba(255, 255, 255, '+o+')')
                  });
  </code></pre>
  
  <p>I need to some how change only the alpha part of the currentColor variable. I hope someone can help me! TIA</p>