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:

  1. shipping info
  2. billing info
  3. 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

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -