jQuery多状态切换

时间:2010-12-17 14:35:49

标签: jquery css button hover toggle

我有三个按钮图像,每个图像有三种状态(启用,悬停,禁用),因此总共有9个图像。这三个按钮是互斥的。因此,单击按钮A将禁用按钮B& C.有没有一种简单的方法在jQuery中执行此操作,或者我是否必须手动显示()/隐藏()点击每个图像的各种组合?

[ Button A (Enabled)  ] 
[ Button B (Disabled) ]
[ Button C (Disabled) ]

[ Button A (Disabled) ] 
[ Button B (Enabled)  ]
[ Button C (Disabled) ]

[ Button A (Disabled) ] 
[ Button B (Disabled) ]
[ Button C (Enabled)  ]

1 个答案:

答案 0 :(得分:2)

jQuery UI有一个单选按钮。演示here