I have the current issue: I define via CSS the current role for a div
element
.divElement:before {
background-image: url(../images/triangle.png);
background-repeat: no-repeat;
content: "";
height: 20px;
left: 62%;
margin: 0 0 0 -50px;
position: absolute;
top: -20px;
width: 100px;
}
.divElement{
background: none repeat scroll 0 0 #FFF8D6;
border-radius: 10px 10px 10px 10px;
color: black;
font: 1em/1.4 Cambria,Georgia,sans-serif;
margin: 0px 500px 3em;
padding: 15px;
position: relative;
text-align: center;
}
I created this element dynamically using jQuery: $('<div class="divElement"><p><strong></strong></p></div>').appendTo(....)
this works correctly. The issue becomes when using jQuery and I try to dynamically change the backgroung-image
and the top
attribute of the content before the divElement
(which I define in CSS with :before
)
I tried something like this for the background-image
, but doesn't work:
$('.divElement:before').css('background-image', 'url(../images/triangle_reverse.png)');
How can I do that? Thank to all !!!