javascript - JQuery UI buttonset misbehaving -


i building ui app using jquery ui elements. need radio buttons part of functionality. while using jquery buttonset works, once try incorporate rest of ui elements don't align properly:

http://jsfiddle.net/seuns/2/

including code here:

$(document).ready(function() {     $("button").button();     $("#tdidir").buttonset();     $("#acqmode").buttonset(); });  <div id='primarylatestcontrol' class="ui-corner-top pacontainer" style='padding: 4px; display: inline-block; '>      <button id="setgain" class="button">set</button>     <span class="label">gain value</span>     <input type="text" id="gainvalue" class="value" value="2"></input>       <button id="setlinerate" class="button">set</button>     <span class="label">line rate, hz</span>     <input type="text" class="value" id="lineratevalue" value="3750"></input>       <button id="setexposetime" class="button">set</button>     <span class="label">exposure time(ms)</span>     <input type="text" class="value" id="exposetimevalue" value="100"></input>       <button id="settdi" class="button">set</button>     <span class="label">tdi direction</span>     <form>         <div id="tdidir">             <label class="checklabel" for="forward">forward</label>             <label class="checklabel" for="reverse">reverse</label>             <input type="radio" class="value" name="tdidir" id="forward" checked="checked"/>             <input type="radio" class="value " name="tdidir" id="reverse"/>             </div>     </form>      <button id="setacqmode" class="button">set</button>     <span class="label">acquisition mode</span>     <form>         <div id="acqmode">             <label class="checklabel" for="tdi">tdi</label>             <label class="checklabel " for="area">area</label>             <input type="radio" class="value" name="acqmode" id="tdi" checked="checked"/>             <input type="radio" class="value" name="acqmode" id="area"/>         </div>     </form> 

.pacontainer {     position: relative;     width: 80%; }  .label {     float: left;     margin: 10px; }  .checklabel {     width: 100px;     float: right;     margin: 10px; }  .endline {     clear: right; }  .button {     float: left;     margin-left: 10px;     clear: left; }  .value {     float: right;     width: 45px;     height: 20px;     margin: 5px;     background-image: none; } 

i made changes code give idea. http://jsfiddle.net/seuns/3/

you want buttons in buttonset ordered because buttonset gives outer buttons round corners , inner buttons 'squished' margins close together. without right ordering, buttonset not right.

floating radio's labels cause radios unordered in buttonset. suggest floating radio's containers instead of labels.

#acqmode, #tdidir {   float: right; } 

and remove float on .checklabels no longer needed

.checklabel {     //float: right; } 

you should keep radio's labels radio inputs. ordering issue buttonsets.

<div id="acqmode">     <label class="checklabel " for="area">area</label>     <input type="radio" class="value" name="acqmode" id="area"/>     <label class="checklabel" for="tdi">tdi</label>     <input type="radio" class="value" name="acqmode" id="tdi" checked="checked"/> </div> 

the last issue need has clearfix. buttonset larger text on same line, next line not straight without clearfix. jquery ui has helper class

ui-helper-clearfix 

i added class line above uneven. class goes on parent of last floated element. (try removing class idea of mean).


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -