javascript - Change DIV width that is before another DIV -
i have structure dynamic divs , have same class, since created automatically.
the problem here that, last of them prior other div other class, have style width:100% instead of width:50% others set css.
here's sample:
<div class="awp_box awp_box_inner"></div> <div class="awp_box awp_box_inner"></div> <div class="awp_box awp_box_inner"></div> <div class="awp_stock_container awp_sct" style="max-width: 400px !important;"></div>
so want change third div, first , one, other times second, other times fourth, etc...
i css time i'm having hard time finding solution one.
can please give me hand here guiding me in right track put working?
based on comments, following script give need.
$(document).ready(function(){ $('.awp_sct').prev().addclass('full'); });
it add class previous element of .awp_sct.
Comments
Post a Comment