Thursday, May 30, 2013

Custom Checkbox and Radio Buttons with Icon Fonts

There are lots of tutorials on how you create your own custom radio buttons and checkboxes with pure CSS. But I haven't seen one that combines the :checked technique AND the use of icon fonts so I thought I should write a little something something on the subject. I'll assume that you already know how much more awesome an icon font is compared to an image or a sprite. A couple of reasons: they scale, they're Retina Ready and it just take a second to change their color or size. It's a long list, trust me!

Convinced? Good! Now the first thing you need to do is create your own custom font. Over at they have a really nice app for this. When you have generated your font, grab the font-face rule that came together with your icon font.

Then in your CSS file you set inputs to display:none, they're ugly as hell remember? Then we'll use the pseudo-element :before on our labels like so:

input[type='checkbox'] + label:before,
input[type='radio'] + label:before {
font-family: 'icomoon';

input[type="radio"] + label:before {
  content: "\e003"; /* Radio Button Unchecked */

input[type="radio"]:checked + label:before {
  content: "\e002"; /* Radio Button Checked */

input[type="checkbox"] + label:before {
  content: "\e000"; /* Checkbox Unchecked */

input[type="checkbox"]:checked + label:before {
  content: "\e001"; /* Checkbox Checked */

Then in the mark-up you write standard html, no rabbit-in-a-hat-tricks!

And there you go! Check out a demo here. This works from IE8 and up, if you need deeper browser support I'd check out Selectivizr. Thank you for reading, hope I helped!

Friday, May 17, 2013

Internet Explorer version ≤8 parseInt() octal radix default

Old browsers, like IE7 and IE8 ( that uses ECMAScript older than 5) uses octal radix ( or base ) as default when parsing strings that start with “0” as ints. Internet Explorer 8 and older versions therefore have this rather peculiar default behavior.

parseInt(“01”) => 1*8^0 = 1
parseInt(“05”) => 5*8^0 = 5
parseInt("055") => (5*8^1)+(5*8^0), 40+5 = 45
parseInt(“07”) => 7*8^0 = 7

parseInt(“08”) => 0*8^0 = 0 (the 8 has no equivalent in base 8)
parseInt(“09”) => 0, same issue

parseInt(“10”) => (0*10^0) + (1*10^1) = 10 ( IE8 recognizes this as base 10, as it doesn’t start with zero.) 

Say that you're parsing months as ints, 01-12. 01-09 will be parsed as base 8, and 10-12 as base 10.
It'll work in all new browsers, but 08 and 09 will be parsed as zero in IE8 or older ( or other old browsers ).

Luckily, for us all, there is a way to specify which base to use.

parseInt(“08”,10) => 8*10^0 = 8

Friday, May 3, 2013

Marketing Automation – Shifting the way we engage individuals.

Insights from Silverpop’s Digital Marketing University

Silverpop’s Digital Marketing University (#DMU13) in Chicago had a packed house, over 200 people poised with pen, pad, and open mind ready to absorb marketing automation knowledge from the experts. Silverpop’s Director of Product Strategy Brian Brown (@GetVision) began the conference with an explanation of what we’re witnessing today, the “channel explosion.” Blogs, Facebook, Twitter, and Pinterest, the list of channels that marketers are asked to leverage continually grows. The more channels, the more work for the marketing team, but not necessary more reward! The channel explosion has changed how we communicate, learn, and buy, explained Brown. Consumers research product information online, and visit retail outlets when they’re ready to purchase. They know the World Wide Web often supports more informed decision-making than sales associates.

Individuals today are required to aggressively filter overwhelming amounts of content a result of the fusion between mass marketing and the channel explosion. How we’re engaging with them online has to change. To reach our customers we must move away from mass marketing, away from segmented marketing, and strive for individual marketing. Think, “share-worthy.” Our focus should change from generating revenue to creating experiences (that generate revenue), suggests Brown. Creating experiences for consumers means timely delivery of content that is uniquely relevant.

In the world of automated marketing we aren’t blasting emails to lists. Information about our customers’ behavior drives our rules for engagement. Listen… “Set it and forget it,” recommended Silverpop’s Product Evangelist Dave Walters. The information utilized to create rules can be anything from pages visited, questions answered, whitepapers downloaded, emails opened, read, or responded to, forms filled out, or any combination of the above. Content delivered can be equally dynamic: emails, sets of emails, web page content, notifications to sales teams, progressive forms, or anything else digital you can imagine. Automation is shifting the marketer’s job to a higher level.

If we view the benefits of marketing automation through a lens of the time management matrix created by Stephen Covey, author of The 7 Habits of Highly Effective People we see that we are able to spend more time on quadrant 2, important and not urgent, activities. In his book Covey emphasizes that quadrant 2 activities --capability improvement, relationship building, recognizing new opportunities, and planning -- provide the most return per time invested. Isn’t that what we’re seeking?

The time management matrix

Marketing teams in the future will spend more of their with whiteboard discussions to identify the best ways to engage individuals. Content creation is still central to the marketer’s strategy, but rather than being delivered at once, content will live forever (or as long as relevant) in the automation system, and delivered to individuals at appropriate times based on defined rules. Over time our base of content and rules for engagement will grow, we will focus our energy on refining our message rather than pressing the send button, and we will witness huge increases in our conversion rates!

If you happen to see one of Silverpop’s Digital Marketing Universities near you I recommend attending! Thanks to everyone at the Silverpop team for putting on a great event.