Recently, I encountered a puzzling situation:
I have an element with the following CSS properties ($(this)
represents the cloned object):
clone.css({
'width': $(this).width() + 'px',
'height': $(this).height() + 'px',
'top': $(this).offset().top - $(window).scrollTop() + 'px',
'left': $(this).offset().left + 'px',
'position': 'fixed'
});
Upon clicking, I apply the following class:
.dupe{
top:0;
left:0;
width:100%;
height:300px;
border-radius:0;
box-shadow:none;
transition:all .3s ease-in-out;
}
Unfortunately, this approach doesn't yield the desired outcome because jQuery overrides it. I prefer not to resort to using !important
.
Is there a way to dynamically prioritize certain CSS rules over others, without the need for !important
?