I am striving to craft a series of divs that feature varying levels of opacity in their background colors, creating a gradient effect.
In an attempt to achieve this, I utilized a variable linked to the ID of each individual div. Unfortunately, my efforts have not produced any fruitful results. It seems I may have taken on a task beyond my current level of understanding.
$(document).ready(function(){
$("div").each(function(index, value) {
var ids = $(this).attr('id');
var opa = ids/10
$("div").css("background-color", "rgba(255, 255, 255, "+opa+")");
});
});
Your assistance is greatly appreciated!