I've been attempting to implement a transition for my elements, but the examples I've come across all rely on the :hover
state. What I really need is for the transition to activate when I click a link.
Here's my HTML:
html
<a id='fireme' href=''>FIRE</a>
<div id='test'> Test title 1</div>
CSS
#test{
background-color: red;
height: 100px;
width: 150px;
transition: all 2s ease-out;
}
.newWidth{
width: 250px;
}
JS
$('#fireme').click(function(){
$('#test').addClass('newWidth')
})
However, when I click the link, no changes occur and the width remains at 150px
Could someone provide assistance with this? Thank you!