Bronzato
Bronzato

Reputation: 9332

Grouping buttons together with jQuery?

I use JQUERY in my ASP.NET MVC application for better user experience. I wonder if it is possible to group buttons together? Not option buttons but simple buttons. For example: is it possible to have buttonA + buttonB + buttonC grouped together followed by some spaces followed bu buttonD + buttonE + buttonF grouped together? Thank you very much :)

Upvotes: 0

Views: 888

Answers (2)

Val
Val

Reputation: 17522

If you are looking for a tool bar this http://jqueryui.com/demos/button/#toolbar link should be very helpful for you...

Also its useful if you have themes on your website ;)

html

<div class="group">
   <button>Button A</button>
   <button>Button B</button>
</div>
<div class="group">
   <button>Button C</button>
   <button>Button D</button>
</div>

js

`$('.group').buttonset();`

css

.group{margin-right: 20px;float: left;}

also check a demo here http://jsbin.com/aniye5/edit

Upvotes: 2

Marnix
Marnix

Reputation: 6547

If you just want some buttons to group and not use some fancy jQuery GUI, you can float:left a ul with li elements next to each other. Something that is done very often.

For example: Check this website with firebug.

Upvotes: 0

Related Questions