javascript - CSS Making a tab bar -


i'm making tab bar pressing appropriate tab button (like web browsers) shows appropriate elements changing visibility property of each of elements. elements not appear right under bar, appear shifted down if isn't first button. because visibility doesn't affect layout , items written 1 after another. want them appear @ top. can't remove them because have javascript properties, , cant position absolute them without them not being able fill container w/h 100%. how thisimg

html

<tab-view id="tabview">                 <tab-bar></tab-bar>                  <tab-content>                     <!-- first tab-content show on page load -->                     <tab-item data-title="meat pizzas">                         <circular-view id="exampleview" data-object-class="exampleobject" data-autoloop-interval="1000 ">                             <circular-object data-icon="resources/examplepizza.png">0</circular-object>                             <circular-object data-icon="resources/examplepizza.png">1</circular-object>                             <circular-object data-icon="resources/examplepizza.png">2</circular-object>                             <circular-object data-icon="resources/examplepizza.png">3</circular-object>                             <circular-object data-icon="resources/examplepizza.png">4</circular-object>                             <circular-object data-icon="resources/examplepizza.png">5</circular-object>                             <circular-object data-icon="resources/examplepizza.png">6</circular-object>                             <circular-object data-icon="resources/examplepizza.png">7</circular-object>                             <circular-object data-icon="resources/examplepizza.png">8</circular-object>                             <circular-object data-icon="resources/examplepizza.png">9</circular-object>                             <circular-object data-icon="resources/examplepizza.png">10</circular-object>                             <!-- last object in list                 first featured on page load -->                         </circular-view>                     </tab-item>                      <tab-item data-title="second thing">                         <div style="width:100%; height:100%; background-color:gray;">                             hi                         </div>                     </tab-item>                      <tab-item data-title="third thing">                         <div style="width:100%; height:100%; background-color:gray;">                             hi                         </div>                     </tab-item>                 </tab-content>               </tab-view> 

button press

tabviewtobe.tabbuttonpressed = function (title) {             //deselect except 1 clicked , show right item             (var in tabviewtobe.bar.buttons) {                 var wasclicked = $(tabviewtobe.bar.buttons[a]).html() == title,                     b = tabviewtobe.bar.buttons[a];                 if (wasclicked === false) {                     b.deselect();                     $(tabviewtobe.items[a]).css("display", "none"); //used visibility, messing around stuff                 } else {                     b.select();                     $(tabviewtobe.items[a]).css("display", "block");                 }             }         }; 

more detail:

sorry, problem here display, have 1 of tab-item animating depending on size. when display: none cant size when move objects in upper left. can't remove objects, , can't use visibility

i fixed using position relative , having negative values 2nd, 3rd, etc item move right place.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -