var xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); var result = xsltProcessor.transformToDocument(xmlDom); var xmls = new XMLSerializer(); var data = (xmls.serializeToString(result)); data = data.replace(/ u are looking to purchase in detail by hovering over it. This brought me to CSS-Tricks.com and the “AnythingZoomer.”

//AN_Xml:

//AN_Xml:

The concept behind the Anything Zoomer was the same as mine… two images on top of each other, where the image in the back gets revealed as you hover over it. But instead of using the script as designed, with the small image in front and the large one in back, I’d make both images the same size, but use the “decoded” version in place of the large image in the back.

//AN_Xml:

//AN_Xml:

To actually make the “decoded” version of my design, I just added a layer above the rest of my artwork in Photoshop and filled it with blue (#0100df), and then added the Layer Multiply effect. From there, I tweaked the levels of the original design a bit to make it easier to read when being decoded.

//AN_Xml:

//AN_Xml:

The Code

//AN_Xml:

I’d love to say that my mastery of CSS shined from here on, but the AnythingZoomer worked pretty much right out of the box for my purposes. I changed the default sizes to work with my images, designed the rest of the page around it, but it was pretty straight forward. There was really only one thing I needed to tweak. In the original script, between the small and zoomed in large image, there is a bit of an offset. So when I used my two images that were both the same size, they didn’t line up. Being a bit out of alignment looks great when using the script for its intended use, but for my purposes, I counteracted most of the offset by putting some additional CSS on the “large” class… margin-top:50px; margin-left:50px;

//AN_Xml:

Finished Webpage

//AN_Xml:

//AN_Xml:

Other Applications

//AN_Xml:

So now you are thinking, “Great, if I ever need to make a web version of something to replicate decoder glasses, now I can.” And that’s true. But you are missing the point. This exact same technique and set of code provided by AnythingZoomer could be used in a multitude of ways that have nothing to do with zooming. I hope to use them all at some point, and at first wasn’t sure I should offer them up. But eventually I decided that the internet will be a better place with this sort of thing popping up everywhere.

//AN_Xml: //AN_Xml:

Project Details

//AN_Xml:

Initial Print Run: 500 posters
//AN_Xml:Cost: Decoder glasses ~ $0.30/each; Poster printing was done in-house.

//AN_Xml:

Timeline

//AN_Xml:

Idea: February 9th, 2012
//AN_Xml:Printed finished posters: February 17th
//AN_Xml:Web-version launched: February 21st

//AN_Xml:

Designing for Decoder Glasses, Print and Web is a post from CSS-Tricks

]]> //AN_Xml: http://css-tricks.com/designing-for-decoder-glasses-print-and-web/feed/ //AN_Xml: 20 //AN_Xml: //AN_Xml: //AN_Xml: Places It’s Tempting To Use Display: None; But Don’t //AN_Xml: http://css-tricks.com/places-its-tempting-to-use-display-none-but-dont/ //AN_Xml: http://css-tricks.com/places-its-tempting-to-use-display-none-but-dont/#comments //AN_Xml: Tue, 28 Feb 2012 05:42:43 +0000 //AN_Xml: Chris Coyier //AN_Xml: //AN_Xml: //AN_Xml: //AN_Xml: http://css-tricks.com/?p=16370 //AN_Xml: Help yourself be better at accessibility by using better hiding techniques that don't use display: none;. This involves some tricks like using more clever class names, being fancier with how you deal with JavaScript library animations, or avoiding hiding all together.

Places It’s Tempting To Use Display: None; But Don’t is a post from CSS-Tricks

]]>
//AN_Xml: You want to hide something on a page, so:

//AN_Xml:
.hide {
//AN_Xml:   display: none;
//AN_Xml:}
//AN_Xml:

But wait! By applying that class to an element you've immediately made that content "inaccessible" by screen readers. You've probably known this forever, but still the poison apple sneaks into our code once in a while.

//AN_Xml:

I don't want to re-hash all the specifics. Your best bet is to read "Now You See Me" by Aaron Gustafson on A List Apart to get an understanding of this if you don't already.

//AN_Xml:

One way to encourage yourself to do the right thing is by creating more appropriate class names. Your regular hide class should position the content off screen, which still leaves it screen reader accessible:

//AN_Xml:
.hide {
//AN_Xml:   position: absolute !important;
//AN_Xml:   top: -9999px !important;
//AN_Xml:   left: -9999px !important;
//AN_Xml:}
//AN_Xml:

I use !important here because if you've gone to the trouble to add a "hide" class to something, you probably mean it and don't want to think too hard about if the specificity value is strong enough. And if you know that you need to display: none something, the class should help you understand it:

//AN_Xml:
.remember-this-will-NOT-be-read {
//AN_Xml:   display: none !important;
//AN_Xml:}
//AN_Xml:

Another option for accessible hiding comes from some Snook research and the HTML5 boilerplate:

//AN_Xml:
.visuallyhidden {
//AN_Xml:  position: absolute;
//AN_Xml:  overflow: hidden;
//AN_Xml:  clip: rect(0 0 0 0);
//AN_Xml:  height: 1px; width: 1px;
//AN_Xml:  margin: -1px; padding: 0; border: 0;
//AN_Xml:}
//AN_Xml:

OK you got it. Easy peasy when you're totally in control of class names and all you do is apply and remove them. But things get a little tricker with JS libraries that apply their own CSS. For instance in jQuery, after you .slideUp(), you'll have a display: none in the inline CSS to deal with. Yes, screen readers run JavaScript and yes, that's still a problem.

//AN_Xml:

Again Aaron Gustafson has us covered there, who suggests applying the accessible class name after the sliding is done and then removing the display: none by sliding it the other direction.

//AN_Xml:
var $button = $('#myButton'),
//AN_Xml:    $text   = $('#myText'),
//AN_Xml:    visible = true;
//AN_Xml:
//AN_Xml:$button.click(function() {
//AN_Xml:  if (visible) {
//AN_Xml:    $text.slideUp('fast',function() {
//AN_Xml:      $text.addClass('hide')
//AN_Xml:           .slideDown(0);
//AN_Xml:    });
//AN_Xml:  } else {
//AN_Xml:    $text.slideUp(0,function() {
//AN_Xml:      $text.removeClass('hide')
//AN_Xml:           .slideDown('fast');
//AN_Xml:    });
//AN_Xml:  }
//AN_Xml:  visible = !visible;
//AN_Xml:});​
//AN_Xml:

Here's a demo of that:

//AN_Xml:

View Demo

//AN_Xml:

Now we have the tools we need to stop using display: none and start using more accessible "hiding" methods.

//AN_Xml:
//AN_Xml:
//AN_Xml:
//AN_Xml:

FAQ pages

//AN_Xml:

If you're hiding the answer until the question is clicked, hide with an accessible class name. Careful you don't .hide() and then slideToggle(), that's not good enough!

//AN_Xml:


//AN_Xml:
//AN_Xml:
//AN_Xml:
//AN_Xml:

Labels

//AN_Xml:

It's tempting to use placeholder text as a label replacement (especially now with some browsers improved UX of leaving the text until you actually type), but don't display: none or remove the labels. I recently heard a heartbreaking story about a blind girl trying to apply for college and the form had missing labels so she had no idea what to put in what fields. So if you're going to use placeholder text as a label replacement, use an accessible hiding technique for the labels.

//AN_Xml:


//AN_Xml:
//AN_Xml:
//AN_Xml:
//AN_Xml:

Tabs

//AN_Xml:

Just because a panel of content isn't the "currently active" one doesn't mean it should be inaccessible. Hide it with an accessible hiding technique instead. Or, you may not even need to. If all the panels are the same height, you can just flip-flop which ones is visible by adjusting z-index.

//AN_Xml:


//AN_Xml:
//AN_Xml:
//AN_Xml:
//AN_Xml:

@media queries

//AN_Xml:

Turning on Voice Over in OS X and using Safari is a screen reader. Now imagine that Safari window was open to a very narrow width and the page had some @media queries for handling smaller viewports. And say that @media query hides some things with display: none in order to better visually accomodate the space. This could be good or bad for accessibility. Are you hiding a bunch of crap that isn't important to the page? Or are you hiding useful things that a person using a screen reader should have access to like they normally would.

//AN_Xml:


//AN_Xml:

No Expert Here

//AN_Xml:

This entire post is based on the premise that display: none is bad for accessibility. It's not based on my deep and thorough understanding of screen readers and general accessibility. If you have more to add, things to correct, or personal experience to share, please do.

//AN_Xml:

Places It’s Tempting To Use Display: None; But Don’t is a post from CSS-Tricks

]]>
//AN_Xml: http://css-tricks.com/places-its-tempting-to-use-display-none-but-dont/feed/ //AN_Xml: 70 //AN_Xml:
//AN_Xml: //AN_Xml: Responsive Navigation Patterns //AN_Xml: http://bradfrostweb.com/blog/web/responsive-nav-patterns/ //AN_Xml: http://css-tricks.com/responsive-navigation-patterns/#comments //AN_Xml: Sat, 25 Feb 2012 15:26:51 +0000 //AN_Xml: Chris Coyier //AN_Xml: //AN_Xml: //AN_Xml: http://css-tricks.com/?p=16350 //AN_Xml:

Brad Frost shows examples and covers the various techniques/pros/cons for handling navigation on small screens.

//AN_Xml:

Direct Link to ArticlePermalink

Responsive Navigation Patterns is a post from CSS-Tricks

]]>
//AN_Xml: Brad Frost shows examples and covers the various techniques/pros/cons for handling navigation on small screens.

//AN_Xml:

Direct Link to ArticlePermalink

Responsive Navigation Patterns is a post from CSS-Tricks

]]>
//AN_Xml: http://css-tricks.com/responsive-navigation-patterns/feed/ //AN_Xml: 0 //AN_Xml:
//AN_Xml: //AN_Xml: //AN_Xml: