javascript - Getting a div to show a different color when a js show and hide effect is in place -
i have checkout system have created. there 3 different parts checkout flow. of these parts in same page. parts are:
- shipping info
- billing info
- order confirmation
basically whenever done shipping info select proceed billing info , shipping info section hides , billing info section shows. same order confirmation.
at top of page regardless of section showing, have call section labels:
<ul class="checkoutmenu"> <div class="checkoutbutton" id="button1labl">1. shipping information</div> <div class="checkoutbutton" id="btnbillinginfolabl">2. billing information</div> <div class="checkoutbutton" id="button3labl">3. order confirmation</div> </ul>
what wanting happen is, in active section customer in, section label different color.
so if in shipping info section, section label different color.
i show , hide different sections this:
$(".shippinginfocontainer").hide(); $('.paymentinfocontainer').show("slow");
how can this? see how have this, site buyfarbest.com. in checkout page.
in css, add class, like:
.active { /* css here highlight */}
then, when hiding, , showing, add , remove class corresponding sections:
$('#button1labl').addclass('active'); $('#btnbillinginfolabl').removeclass('active');
Comments
Post a Comment