开发者

Grouping buttons together with jQuery?

开发者 https://www.devze.com 2023-02-22 18:30 出处:网络
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

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 + button开发者_如何学JAVAC grouped together followed by some spaces followed bu buttonD + buttonE + buttonF grouped together? Thank you very much :)


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消