How to make JQuery + CSS Verticle Tabs
Tags: jquery,css
Problem :
Having trouble with my tabs, the Jquery is not functioning as i expect it to.
Im trying to create verticle tabs to display different information, but my jquery is not functioning.
- I am trying to hide all the divs except the first one.
- Then when one of the tab lists is clicked the active class gets added to that and removed from the other.
- finally hide all the divs and show the one which was clicked.
$(document).ready(function() {
tabContent();
})
function tabContent() {
$('#tabsD div:not(:first)').hide();
$('#tab-container li').click(function(event){
var id = $(event.target).index();
$('.active').removeClass('active');
$(event.target).addClass('active');
$('#tabsD div').hide().eq(id).show();
});
}
Solution :
Use this -
var id = $(this).index('li');
Demo --->
http://jsfiddle.net/HjYZ6/6/
CSS Howto..
Also apply text-align: center; on the html element like so: html { text-align: center; } A better approach though is to have an inner container div, which will be centralized,...
Use :not: .beigeButton:not(.enabledButton) ...
use adjecent css3 selector to work around your issue. its better to have mere specific selector. Please see the fiddle li.specialItemClass + li.specialItemClass{ border-top:none; } https://jsfiddle.net/0ou3a02u/ ...
You need to float both the .button_outside_border and the .status_text to the left like in this example. You still have a bit of cleaning up do to get it pixel...
The lightweight method is to use CSS, and use the property background-image of the div: jsFiddle <div id="featured-box-right"></div> CSS: #featured-box-right { width: 300px; height: 150px; background-image: url('http://i.stack.imgur.com/OywDf.png'); } #featured-box-right:hover {...
As mentioned, to refer to an element with a . in its tag name you can simply escape it: a\.b But the same can't be said for a b:c element,...
No need of using position: absolute; every time. Demo Below is updated code: HTML: <div> <div class="slideHeader"> <img align="left" style="padding-right: 20px;" src="https://cdn3.colorlib.com/dazzling/wp-content/uploads/sites/6/2013/03/image-alignment-150x150.jpg"> <h1 style="padding-left:...
Well for example in this picture : All the purple are dots where your 'ball' should go through. You can see each dot as a key-frame. There are 16 dots...
You can use CSS3's :not() selector. For example, in style2.css, you would write: select:not(#select1) { // styling here will be applied to all selects except select1 } But in reality...
The answer!! img {img-width : none;} Thanks to an answer from Github on the bootstrap issues... Would appreciate Madth3 and Roman C correcting...
Put a background color on the span to see why it isn't working. Those three items are in a div with no CSS associated with it. In order for the...
Adding to your table a table-layout: fixed styling should achieve what I believe you are wanting. Add it either inline (like you are already doing) or as part of your...
You can add multiple classes using css modules as follows: className={styles.description + ' ' + styles.yellow} function Footer( props) { const { route } = props; return ( <div className={styles.footer}>...
DEMO /*styled relative to the label*/ label {display:block;} label ~ div {display:none; margin-left:1em;} /*targetting*/ /*boxes with id having this number will style a sibling div with this number*/ input[type="checkbox"][id*="131"]:checked ~...
The text is centered, just the table doesn't fill the width of its enclosing area: table.t_group_matches {width:100%} ...
Use the content property in ::after or ::before pseudo-element to add additional text. You can also position it elsewhere with absolute and top/bottom,left/right properties. #site-title::after { content: "Another Title"; /*...
in your css you will want to add two styles #access li { width: 25%; } #access li:last-of-type, li#menu-item-31{ border-right: none !important; width:24% !important; } the first will make each...
hope this work for you $a=0; foreach ($data[0] as $data) { if ($data == a) { echo "<div style='margin-left: ".$a."px; '><img src='img/server_s.png' style='float: left;'></div>"; } elseif ($data == b) {...
I found the solution: in the general menu -> content types option I can add a file association to the css content type.
I think you can use delay: animation-delay:4s; -moz-animation-delay:4s; /* Firefox */ -webkit-animation-delay:4s; /* Safari and Chrome */ -o-animation-delay:4s; /* Opera */ (adjust number to fit)...
Removing A Style If you want to remove a single specific style that is being applied to an element, you can simply set that style to an empty string :...
You can do following way using display:inline-block;. Put first line header in one div. And the give it display:inline-block; to it and and second line navbar .nav_main and vertical-align:top; and...
As of now (January 31st 2015) there is a way to do that without using canvas, with pure CSS, and with only 2 lines of code. The trick is using...
Here's a code example: http://codepen.io/anon/pen/inmwD Either use a wrapping div or a list element <div class="parent"> <div class="row"> <div class="col1">1</div> <div class="col2">Content</div> <div class="col3"><input type="radio"/></div> </div> </div> ...
To prevent the flex items from shrinking, set the flex shrink factor to 0: The flex shrink factor determines how much the flex item will shrink relative to the rest...
Your SCSS li { // active pseudo on li &:active { i { color: #your-active-color; } } a { // active pseudo on a link &.active { i { color:...
Make the line-height of the div the same as the height of the div, eg: #UploadSuccess { height: 20px; line-height: 20px; } This will only work if you have one...
You aren't closing your div tag <div class="section" id="medias"> <div class="center"> <iframe width="350" height="200" class="youtube-player" src="http://www.youtube.com/embed/qqXi8WmQ_WM" frameborder="0" allowfullscreen></iframe> <div id="medias-txt"> <p>hello</p></div>...
Yes, ther solution to your problem is using transform-style: preserve-3d. But the problem with this is that IE does not support this property A way to make it work in...
You should start with a simple component and then later add jQuery support to it. In the book of vaadin 6 there is a chapter about component development https://vaadin.com/book/vaadin6/-/page/gwt.html For...