jQuery UI split button toggle - toggle both parts of the button

Posted by the berserker on Stack Overflow See other posts from Stack Overflow or by the berserker
Published on 2013-11-03T21:51:26Z Indexed on 2013/11/03 21:53 UTC
Read the original article Hit count: 293

Filed under:

I would like to implement a toggle splitbutton with jQuery UI that would on toggle action change the style of the "dropdown" part as well (as seen in http://jsfiddle.net/8khz2/3/ - I'd like to appear it on 1st click as white, same as "Toggle" button does).

Does anyone see a way to achieve that out of the box or only with CSS, without additional javascript code?

Somehow I don't see an option doing it only with CSS, since I can not nest the "dropdown" button in "Toggle", since toggle part is checkbox:

<input type="checkbox" id="toggle"/><label for="toggle">Toggle</label>
<button id="select">Select an action</button>

The jsfiddle example is based on: http://jqueryui.com/button/#splitbutton

© Stack Overflow or respective owner

Related posts about jquery-ui