I understand the :active
state to some degree, but I don't know how to transform my box1
by clicking (without holding.) Instead, to transform I need to click and hold the box for the entire duration of the transformation.
https://jsfiddle.net/kzmhtkog/4/
.wrap {
width: 100%;
height:400px;
overflow:hidden;
}
#box1 {
background-color:red;
text-align:left;
cursor: pointer;
-webkit-transition: width 1s;
transition: width 1s;
}
#box1:active {
width: 100%;
background-color: red;
}
.floatleft {
float:left;
width: 33.33%;
background-color: black;
height: 400px;
}
<div class="wrap">
<div class="floatleft" id="box1">
</div>
</div>