Blog

Codes, snippets, tips and tricks for web designers using Adobe Business Catalyst, jQuery, CSS3, HTML5 and Respsonsive Design.

21-5-2012

How to Show/Hide a div based on day of the week with jQuery

HTML <div id="sunday"> <h3>Sunday</h3> </div> <div id="monday"> <h3>Monday</h3> </div> <div id="tuesday"> <h3>Tuesday</h3> </div> <div id="wednesday"> <h3>Wednesday</h3> </div> <div id="thursday"> <h3>Thrursday</h3> </div> <div id="friday"> <h3>Friday</h3> </div> <div id="saturday"> <h3>Saturday JavaScr ..

Read more

17-5-2012

How to Create a Countdown Timer that Refreshes the Page Daily with Javascript

JavaScript <script type="text/javascript"> function getSeconds() { var now = new Date(); var time = now.getTime(); var midnight = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0); var ft = midnight.getTime() + 86400000; var diff = ft – time; diff = parseInt(diff / 1000); if (diff > 86400) { diff = diff – 86400 } startTimer(diff); } var timeI ..

Read more

16-5-2012

Simple and Smooth Expand and Collapse with jQuery

HTML example <h2 class="myClass" id="trigger1">Click here to expand</h2> <div class="hide-container"> <p>Here goes whatever you want to expand/collapse</p> <p>Here goes whatever you want to expand/collapse</p> <p>Here goes whatever you want to expand/collapse</p> <p>Here goes whatever you want to expand/collapse</p> </div> CSS .myClass {font-size:20px; color: #FF0000;} div#hide- ..

Read more

02-11-2011

How to display fields using select drop down and jQuery

<script type="text/javascript"> $(document).ready(function(){ $("#Select").change(function(){ if ($(this).val() == "Other" ) { $("#OtherField").show(); } else { $("#OtherField").hide(); } }); }); </script> ..

Read more

27-10-2011

How to Change the Default Text Selection Color with CSS

If you want to change your website's default text highlight color with any color of your choice, you can use the CSS3 declaration " ::selection" , which will replace your browser-level default text highlight color with a color that better suits your design. See the example below with a RED for the background and WHITE for the text. /* Firefox */ ::-moz-selection { background-color: #FF0000; color: #fff; } /* Safari */ ::selection { background-color: ..

Read more