I am trying to modify a single attribute in my class using a JavaScript function.
.msg_archivedropdown:before {
content:"";
display: block;
position:absolute;
width:0;
height:0;
left:-7px;
top:0px;
border-top: 10px solid transparent;
border-bottom:10px solid transparent;
border-right:7px solid #FFFFFF;
}
Since I am already utilizing jQuery, I attempted to achieve this with addClass
:
function colorbubble(){
$("archivedropdown before").addClass("msg_archivedropdownhover before");
}
The newly added class only alters the border color:
.msg_archivedropdownhover:before {
content:"";
display: block;
position:absolute;
width:0;
height:0;
left:-7px;
top:0px;
border-top: 10px solid transparent;
border-bottom:10px solid transparent;
border-right:7px solid #DFDFDF;
}
Unfortunately, the changes are not reflecting. I have attempted multiple methods without success, including:
$('.msg_archivedropdown before').css('border-right-color','#DFDFDF;');
Neither looping through getElementsByClass
worked for me. I must be overlooking something. Any hints would be greatly appreciated. Thank you.
EDIT:
This involves modifying a speech bubble where I created a triangle within the .msg_archivedropdown:before
class. I aim to change the triangle's color on a mouseover
event by solely adjusting the color of the .msg_archivedropdown:before
class.