Friday, 10 February 2012

how to implement this?


if grateful!

how highlight opening hours day user accesses website in table, hard explain if at

http://www.hallmark-cars.co.uk/contactus#hours

how highlights day today

source code part:

<div class="hourswrap">
<h3>main branch</h3>
<table class="hourstable">
<tr id="hours-monday" class="hours-standardday"><td>monday</td><td>9:30 am</td><td>to</td><td>6:30 pm</td></tr>
<tr id="hours-tuesday" class="hours-standardday"><td>tuesday</td><td>9:30 am</td><td>to</td><td>6:30 pm</td></tr>
<tr id="hours-wednesday" class="hours-standardday"><td>wednesday</td><td>9:30 am</td><td>to</td><td>6:30 pm</td></tr>
<tr id="hours-thursday" class="hours-standardday"><td>thursday</td><td>9:30 am</td><td>to</td><td>6:30 pm</td></tr>
<tr id="hours-friday" class="hours-currentday"><td>friday</td><td>9:30 am</td><td>to</td><td>6:00 pm</td></tr>
<tr id="hours-saturday" class="hours-standardday"><td>saturday</td><td>10:00 am</td><td>to</td><td>4:00 pm</td></tr>
<tr id="hours-sunday" class="hours-standardday"><td>sunday</td><td>11:00 am</td><td>to</td><td>3:00 pm</td></tr>
</table><p class="hourstext">the time 11:22pm. sorry closed.<br>we open on saturday 10:00am.</p><p class="hourstext">tel: 01234 360036</p>
<p class="hourstext">hours may change on public holidays - please contact prior travelling</p>
 

well, can use javascript or whatever server-side language you're using detect current day of week , give corresponding line in table specific css class/id desired styling. in example, current day's line has class of "hours-currentday", while others have "hours-standardday".

here's how in javascript: http://w3schools.com/jsref/jsref_getday.asp
 


Forums Special Interests Web Design and Development


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment