当前位置: 动力学知识库 > 问答 > 编程问答 >

css - 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?

网友答案:

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: