I wondering if anyone has successfully made eBay style checkboxes that work cross browser?
To illustrate:
Go to www.ebay.co.uk, do a search for something and then look at the select boxes on the left hand side under ‘condition’ and ‘buying format’. I want to create something similar.
The select boxes don’t have to be done with <input type=“checkbox”> code, as long as the code validates and the visual effect is the same.
Does anyone have any pointers for how this might be achieved?
Yes, already did that but couldn’t make head nor tail of the markup. The sprite state seems to be called by a <b></b> tag so presumably this is Javascript at play? Apologies but whilst I’m fine with checking Markup and CSS with Firebug I struggle to figure out the Javascript side of it.
The pseudo checkboxes are background images applied to b elements nested within a elements nested in a divs.
If the parent div has the class asr-nd, the background image sprite is positioned to show the empty box.
If the parent div has the class asr-sd, or is hovered, the background position is set to show the filled box.
If the parent div has the class asr-sd, hovering moves the background position to show a cross.
Examples of the markup and some of the CSS involved. These are just pointers rather than a step by step guide to replicating the original or the programming employed in applying the class to selected items.
Victorinox - thanks for that - excellent. Makes perfect sense. Just need to write some jQuery now to try and bash together something similar (scrabbles around for sitepoint jQuery book).
Thanks again for taking the time to break that down.