htmlCODE:
<body style="padding: 80px; z-index: -2">
<div class="reaction" style="border-radius: 50%; background-color: blue; width: 40px; height:40px; z-index: 1">
<div class="" style="position:absolute; border-radius: 50%; background-color: purple; width: 40px; height:40px; z-index: 0;"></div>
<div class="circle" style="position:absolute; border-radius: 50%; background-color: skyblue; width: 40px; height:40px; z-index: 0"></div>
</div>
</body>
Well working jQueryCODE:
$('.reaction').mousedown(function () {
$(this).find('div').css('left', '70%');
});
This CODE seems to working well, but
Worse working jQueryCODE:
$('.reaction').mousedown(function () {
$(this).find('div.circle').css('left', '70%');
});
This Worse CODE is also works but it make the size of div.circle to 0*0 from 40*40 in elements tap of browser developer tools. (style="left: 70%;" seems to be working well)
Why size of .circle goes 0 * 0 after Worse working jQueryCODE?