schwern
schwern

Reputation: 1

Recreating jQuery UI's "Selectable" Interaction in CSS3

Is there a way to use CSS3 to recreate the behavior of jQuery UI's Selectable interaction, specifically in a grid setup, as seen here?

Upvotes: 0

Views: 47

Answers (1)

Andy
Andy

Reputation: 14575

Yes, this can be achieved by using a radio buttons :checked selector and the sibling selecter (+ or alternatively ~)

You essentially have radio buttons that the user can choose, but hide them, and use <label>'s with for="" attributes.

Demo

This doesn't let you drag or control click to select multiple boxes however, you would need javascript (and checkboxes rather than radio buttons) for that

Upvotes: 1

Related Questions