How to Code a jQuery Rolodex-Style Countdown Ticker
by Jake Rocheleau on May 17, 2012
I’m sure many of you are familiar with how an office rolodex works. You have a series of cards with contact information which you can flip over to sort through alphabetically. These are most common in the office settings because businesses must to keep in touch with so many different people. Although the value is in translation into a web interface, we can still use this idea to create a really neat timer effect.
More specifically I have seen a couple countdown widgets on landing pages. These are numbering systems for websites which count down to a specific launch date. You could alternatively use this code to create a live clock on your website – there are so many uses available! Check out my simple tutorial below and see if you can implement a similar ticker into any future web projects.
Live Demo – Download Source Code
Selecting Graphics
I am admittedly not an amazing Photoshop design guru. I can put together some unique web layouts and magazine themes – but I can’t create a whole rolodex stack from scratch. This is where the large network of PSD freebies comes in handy.
I really love this flip-clock countdown for both the gradients and textures. This was created by Orman Clark who also built the website Premium Pixels. Just download the PSD and extract a single card stack background. We will use this same background for each of the time slots – days, hours, minutes, and seconds.
However I want to use dynamic HTML inside each div to update the counter. So when you extract these blocks make sure you hide all the text layers, including the bottom labels. Or even easier just download my tutorial source code above and use the included images.
Core HTML Layout
For this example we don’t need a whole bunch of confusing HTML markup. I’m using a containing div #clock-ticker set with a clearfix class, and inside we have 4 different floating divs. These are set to the class .block and each contains a single column of the countdown clock.
<div id="clock-ticker" class="clearfix"> <div class="block"> <span class="flip-top" id="numdays">8</span> <span class="flip-btm"></span> <footer class="label">Days</footer> </div> <div class="block"> <span class="flip-top" id="numhours">14</span> <span class="flip-btm"></span> <footer class="label">Hours</footer> </div> <div class="block"> <span class="flip-top" id="nummins">34</span> <span class="flip-btm"></span> <footer class="label">Mins</footer> </div>
Inside a single block area we have three core sections. The top two span elements contain the top and bottom portion of each rolodex card. By splitting up the card we could use some further jQuery UI animation effects. But this goes much further than I’d like to cover here – although it is possible to build off this preset code.
#clock-ticker { display: block; margin-bottom: 15px;}
#clock-ticker .block { position: relative; color: #fff; font-weight: bold; float: left; margin-right: 22px; }
#clock-ticker .block .flip-top { width: 88px; height: 39px; line-height: 75px; font-size: 55px; background: url('img/flip-top.png') no-repeat; text-align: center; }
#clock-ticker .block .flip-btm { width: 88px; height: 40px; background: url('img/flip-btm.png') no-repeat; text-align: center; }
#clock-ticker .block .label { color: #fbfbfb; font-weight: bold; font-size: 14px; text-transform: uppercase; width: 88px; line-height: 35px; text-align: center; font-family: "Calibri", Arial, sans-serif; text-shadow: 1px 1px 0px #333; }
The last area contains the label text for each card. This is held inside an HTML5 footer element and styled with a bit of CSS. I should point out how many of these elements are set to a fixed height. This means we can ensure the layout won’t break even if our numbers were “too big” and pushed outside the box model.
Detecting Clock Numbers
Inside the top span area of each column I’ve appended some default numeric values. You can change these to whatever you’d like and the script should still count down directly to 0. But just remember you don’t need anything in the bottom section, and actually I built it this way to keep the code cleaner.
Our goal would be to then check each of these numerical values on pageload and set them to static variables. You can see I have done this within the first few lines of JavaScript. The jQuery library is included in the doc header, but all our JS codes are actually inside a script tag towards the bottom of the page.
<script type="text/javascript">
$(document).ready(function(){
var theDaysBox = $("#numdays");
var theHoursBox = $("#numhours");
var theMinsBox = $("#nummins");
var theSecsBox = $("#numsecs");
These variables target the span elements themselves, and not the internal content. We do this in a different set of vars because the numbers will be updated every second. I’ve stuck with plain JavaScript and the setInterval() method.
Using this predetermined timing function we offer an internal set of code to call every set number of milliseconds. In this example we call the function code every 1000 milliseconds, or 1 second. Let’s look at some example syntax first:
var myNewIntval = setInterval(function() {
/// we use code here
}, 1000);
The method only requires 2 parameters with the latter being a number of milliseconds. The first is the code you wish to execute every set interval of time – most ideally we want to use a custom function. Alternatively we could write a new function name and call this, but we aren’t saving much space either way.
JavaScript setInterval()
Even if you aren’t totally familiar with this method don’t worry too much since it’s easy to catch up. Let’s push forward with the script and look at our real-live example.
var refreshId = setInterval(function() {
var currentSeconds = theSecsBox.text();
var currentMins = theMinsBox.text();
var currentHours = theHoursBox.text();
var currentDays = theDaysBox.text();
Inside the interval function we’re setting another four variables. These will be updated each second to contain the new value of each span element. Since we’re counting down to a specific number I’m going to use a very basic set of logic to check the timers.
In layman’s terms we need to see if any of the numbers reach 0 during any given interval. If that’s the case we can’t let it turn to -1 in the next second, and so instead we deduct a value from the next set (secs -> mins -> hours -> days).
Base Timing and Logic
Anybody who is familiar with basic if/else statements should be able to follow this script. We’re going to check at each interval if any of the numerical values have hit 0 – or if more than one value has hit 0.
For example, if the seconds and minutes have reached 0 then we need to remove 1 hour from the clock and reset the mins/secs to 59. Same when the hours, minutes, and seconds reach 0 and we need to remove 1 day from the clock.
if(currentSeconds == 0 && currentMins == 0 && currentHours == 0 && currentDays == 0) {
// if everything rusn out our timer is done!!
// do some exciting code in here when your countdown timer finishes
} else if(currentSeconds == 0 && currentMins == 0 && currentHours == 0) {
// if the seconds and minutes and hours run out we subtract 1 day
theDaysBox.html(currentDays-1);
theHoursBox.html("23");
theMinsBox.html("59");
theSecsBox.html("59");
} else if(currentSeconds == 0 && currentMins == 0) {
// if the seconds and minutes run out we need to subtract 1 hour
theHoursBox.html(currentHours-1);
theMinsBox.html("59");
theSecsBox.html("59");
} else if(currentSeconds == 0) {
// if the seconds run out we need to subtract 1 minute
theMinsBox.html(currentMins-1);
theSecsBox.html("59");
} else {
theSecsBox.html(currentSeconds-1);
}
I’m using the jQuery .html() method to set the internal value for each span. The very first if() {} statement checks for the timer completely running out, and you can place any code inside here. This could fade out and display a signup/registration form. Or it could re-direct visitors to a new page once the timer has finished.
There is definitely a lot you can do to customize this code for your own ideas. The clock will always tick down in this code, but that is easy to change. And if you refresh the page all values will reset to their original static setup inside the HTML document. Unfortunately session variables are controlled on the server end, so there’s no way to do this using solely JavaScript.
Live Demo – Download Source Code
Conclusion
I hope this quaint clock ticker can be useful to some web designers. It’s a cool widget when you need it, but it’s also hard to just squeeze into a web layout. Practicing with JavaScript is also handy the more you move into web development techniques. Feel free to download my source code and play around on your own. If you have any ideas or suggestions you can share with us in the post discussion area below.
Simple Non-Profit WordPress Theme
by Steven Snell on May 17, 2012
With this free WordPress theme any non-profit organization can have an effective website. It includes features to showcase your programs and events, and several elements are easily customizable. Organizations with limited budgets can present a professional image with this WordPress theme.
Theme features include:
- 7 color schemes from which to choose (screenshots of each are shown lower on this page)
- Customizable homepage slider
- Events calendar
- Organization news publication
- Upload your logo, or just use the site name in text
This WordPress theme was created with non-profit organizations in mind, including features that are needed by most organization websites. The homepage slider allows you to promote your programs and services, or attract attention to any initiative. Images in the slider can be linked to any page.
Most organizations have a lot of events going on, and with this theme you can have an effective event calendar. The homepage even displays 5 upcoming events for added exposure. When you set up the events you insert the date and time, and as it passes the event will be automatically removed from your site so you don’t have to remember to delete each event as it occurs.
The theme also includes a custom post type for news announcements, so you can publish press releases or other announcements and have them featured on your website. As with any WordPress-based site, blogging functionality is included. The theme’s home page template includes links to the most recent blog posts.
WordPress’s custom navigation menu feature is used for both the header and footer menus, so you have complete control over the links that are shown in your menus. The header menu supports drop downs.
From the WordPress dashboard you can enter links to your Facebook page and Twitter profile and the footer icons will be linked appropriately. If you don’t have social media profiles, simply leave the URL fields blank and no icons will be displayed.
Scroll down to see the alternate color schemes.
Documentation for the theme is available in this PDF file.
View the theme demo | Download for free
We Recommend BlueHost
If you’re looking for a hosting company, we recommend BlueHost. They offer quality shared hosting and responsive customer service at low prices. The video below shows how to sign up with BlueHost, install WordPress, and upload one of our free themes in a matter of just a few minutes. Read a more detailed explanation of why we recommend BlueHost.
Alternate Color Schemes:
Helping Your Clients Build an Effective Mobile Strategy
by Jacob Gube on May 17, 2012
It can be a challenge convincing clients to add new strategies to their existing Web presence.
In a perfect world, a client would simply say, "You’re the expert. You know what’s best. Do whatever needs to be done to make it happen!" But, unfortunately, it just doesn’t work like that.
Granted, we shouldn’t expect smart business managers to implement every new thing just because we tell them it’s a good idea. That wouldn’t be cost effective. But what if you know in your gut that the future of a client’s business may be at stake?
With Google executives saying things like "I believe that in 3 years desktop computers will be irrelevant…" and studies by Gartner stating that "Websites not formatted for the smaller screen will become a market barrier…" the Mobile Web is one of your gut instincts you want your clients to follow. And follow now!
In a state of desperate urgency, you may be tempted to place all diplomacy aside, and just tell it to them straight, perhaps even reminding them of those other times they put off your advice. I like to call this the "Timeline of Lost Opportunities" tactic.

You may very well have clients who respond to that type of pressure, but more likely, you will need to ease your clients into the idea of a full-on Mobile Web strategy.
Below is a plan that can help. I’ve even included graphics in each step since, as the old adage goes, "A picture is worth a thousand different ways of pleading with one’s clients." (Or something like that.)
Step 1: Show Them the Money

The Mobile Web is upon us, whether we like it or not. People are using mobile devices to search, shop and click through on ads at unprecedented rates. And rates that are only expected to grow. Presenting numbers like those shown above, as well as information on how their competitors may already be capitalizing on the Mobile Web, can get your clients listening.
Step 2: Show Them What Their Customers Expect

Mobile device users search the Internet as often as they use apps, so having a mobile-ready website is important. Mobile consumers know what they want from a website, and typically take action once they get there. It’s important that your clients understand that their customers have different expectations of what a mobile website does and provides compared to their existing website. Mobile conversion rates can be impressive, but only if a website caters to the expectations of this mobile audience.
Step 3: Outline Best Practices and Give Them Choices

Once you’ve shown your clients how people use mobile devices, it should become more apparent that they need a mobile version of their website. Mobile website solutions need not be complicated or expensive. Show your clients some options, such as responsive web design or going with a dedicated mobile-optimized version of the site (along with the pros and cons of each) while emphasizing mobile website best practices.
Step 4: Help Them Decide Whether They Need a Mobile App

Mobile app usage is impressive, but while people do spend a lot of time using mobile apps, most of that time is spent on games and social networking. So does your client really need a mobile app? You can help them decide by weighing the pros and cons of mobile app development, and presenting ways they can optimize their mobile website as an alternative.
Step 5: Explain the Marketplace and Mobile App Nuances

A good mobile app strategy should analyze current marketplace trends and weigh the pros and cons of developing native apps versus web apps. Be sure to explain how the mobile marketplace works as well as the difference between native and web apps. This can help your clients make more informed decisions.
Step 6: Show Them Options and Give Them Choices

Mobile app solutions vary in price and complexity. Outline options for your client that include using HTML5 or one of the many do-it-yourself mobile app tools available today. Make your recommendations based on the client’s present and future needs.
Step 7: Introduce Other Mobile Marketing Tactics

The Mobile Web is more than just websites and apps. From QR codes to augmented reality, there are a host of tactics and tools you can implement to help your clients promote their business on the Mobile Web. Help your clients understand the importance of mobile-optimized landing pages. When they are marketing to a mobile audience, it is imperative that clients ultimately send potential customers to landing pages and other sources compatible with the customer’s mobile device.
The goal should be to educate your clients on the "hows" and "whys" of the Mobile Web and to help them understand their options. This approach can ultimately help them make informed decisions as they consider your recommendations.
This article is based on the book, The Bootstrapper’s Guide to the Mobile Web. The graphics used in this article are part of a sharable infographic available at TheBootstrappersGuide.com, where you’ll also find free mobile website, mobile app, and other mobile strategy worksheets.
Related Content
- Mobile UI Design Patterns: 10+ Sites for Inspiration
- Will the Browser Wars Invade the Mobile Web?
- 10 Excellent Tools for Testing Your Site on Mobile Devices
- Related categories: Mobile and Project Management
About the Author
Analog Art: A Showcase of Fabulous Pencil Drawings
by Angie Bowen on May 17, 2012
For most of us, one of the first tools we use for drawing pictures (beyond the crayons and finger paint of our early days) is a pencil. Be it a lead based or colored pencil, these analog artist tools are still a big staple among artists and designers alike. As designers many of us keep our handy notebooks and pencils within reach for the beginnings of any new designs or projects that come our way. Today’s inspirational collection may just have you reaching for that notebook and pencils before its done.
In this post you will find numerous stunning examples of pencil drawings that will have your jaws on the floor. Shocked that many of these imaginative pieces were created with colored or lead based pencils alone. Such amazing artistry on display, that we are sure it will delight and inspire all of our readers.
Analog Art
Lady of Spiders by TeSzu
Stone Face by fabaorts
Small Blessings by Cataclysm-X
Please hold my hand tightly by hellobaby
Vengeance of a Bride by lehanan
Decay by MelloLover
Mysterious one behind the shadows by PearlEden
Pearls by witchi1976
The Remnant by shimoda7
Windswept by imaginee
Dark Hope by Zindy
Fangs III, pencil by Panthera11
Jean Harlow Minimal by Ileana-S
Katiebloo by TeSzu
Buho Cornudo by faboarts
Metamorphosis by Cataclysm-X
Hold your hand by hellobaby
Voulez-vous…? by lehanan
Complementary by Loonaki
Feathered eye by witchi1976
Waiting by shimoda7
The Face Of David by imaginee
It went away by Zindy
Cat 3 by tajus
In Solitude… by Ileana-S
Unspoken Words by Snow-Owl
Yuri by KLSADAKO
Wroclaw Ostrow Tumski by TeSzu
Basset hound by faboarts
You May Kiss The Bride by imaginee
Elegancy by Cataclysm-X
My dear. let me show you by hellobaby
Childhood in Minor by lehanan
Mirror of Earth by PearlEden
Braid by witchi1976
Can’t turn back time by shimoda7
Portrait of Dakota by imaginee
Unleash the butterflies by Zindy
Self Portrait with Tools of Trade by Ileana-S
Playful curls – Pencil drawing by Regius
That’s All, Folks
That finishes up the collected works, but it doesn’t have to end there. Now we turn the comment section over to you so you can fill us in on your favorites from the showcase. Do you know of some other pencil drawings that would have made a nice addition to the list? Provide us a link so other readers can check them out.
(rb)
Analog Art: A Showcase of Fabulous Pencil Drawings
by Angie Bowen on May 17, 2012
For most of us, one of the first tools we use for drawing pictures (beyond the crayons and finger paint of our early days) is a pencil. Be it a lead based or colored pencil, these analog artist tools are still a big staple among artists and designers alike. As designers many of us keep our handy notebooks and pencils within reach for the beginnings of any new designs or projects that come our way. Today’s inspirational collection may just have you reaching for that notebook and pencils before its done.
In this post you will find numerous stunning examples of pencil drawings that will have your jaws on the floor. Shocked that many of these imaginative pieces were created with colored or lead based pencils alone. Such amazing artistry on display, that we are sure it will delight and inspire all of our readers.
Analog Art
Lady of Spiders by TeSzu
Stone Face by fabaorts
Small Blessings by Cataclysm-X
Please hold my hand tightly by hellobaby
Vengeance of a Bride by lehanan
Decay by MelloLover
Mysterious one behind the shadows by PearlEden
Pearls by witchi1976
The Remnant by shimoda7
Windswept by imaginee
Dark Hope by Zindy
Fangs III, pencil by Panthera11
Jean Harlow Minimal by Ileana-S
Katiebloo by TeSzu
Buho Cornudo by faboarts
Metamorphosis by Cataclysm-X
Hold your hand by hellobaby
Voulez-vous…? by lehanan
Complementary by Loonaki
Feathered eye by witchi1976
Waiting by shimoda7
The Face Of David by imaginee
It went away by Zindy
Cat 3 by tajus
In Solitude… by Ileana-S
Unspoken Words by Snow-Owl
Yuri by KLSADAKO
Wroclaw Ostrow Tumski by TeSzu
Basset hound by faboarts
You May Kiss The Bride by imaginee
Elegancy by Cataclysm-X
My dear. let me show you by hellobaby
Childhood in Minor by lehanan
Mirror of Earth by PearlEden
Braid by witchi1976
Can’t turn back time by shimoda7
Portrait of Dakota by imaginee
Unleash the butterflies by Zindy
Self Portrait with Tools of Trade by Ileana-S
Playful curls – Pencil drawing by Regius
That’s All, Folks
That finishes up the collected works, but it doesn’t have to end there. Now we turn the comment section over to you so you can fill us in on your favorites from the showcase. Do you know of some other pencil drawings that would have made a nice addition to the list? Provide us a link so other readers can check them out.
(rb)



















































