SwampGuzzler on master
tabsProject initial commit Oldest Parent inital commit Merge pull request #230 from LP… (compare)
SwampGuzzler on master
Added oldestlivingparent assign… Added tabs with ajax assignment added tab-angular assignment and 1 more (compare)
toastynerd on master
adding assignment 5.1 adding 5.1 adding solution for last assign… and 1 more (compare)
hankyates on master
Find oldest living parents from… Tab Example with GET request fr… Tab Example by using Angularjs and 1 more (compare)
hankyates on master
First Commit of Ajax Assignment Merge branch 'master' of https:… Merge pull request #221 from st… (compare)
hankyates on master
version 1, assignment 7.1 first version of assignment 6.1 first version of assignment 6.1 and 7 more (compare)
$(document).ready(function() {
$('#show-tab').addClass('active-tab');
$('#show-content').addClass('active-content');
$('.tabs').on('click', function() {
var selected = $(this).attr('.tabs > class');
$('.tab-text').fadeOut('slow');
$('.tab-content').removeClass('active-content');
$('.tabs').removeClass('active-tab');
$('this').addClass('active-tab');
$('.tab-content' + '.' + selected).fadeIn('slow');
console.log(selected);
});
});
$(document).ready(function() {
$('#show-tab').addClass('active-tab');
$('#show-content').addClass('active-content');
$('.tabs').on('click', function() {
var selected = $(this).attr('.tabs > class');
$('.tab-text').fadeOut('slow');
$('.tab-content').removeClass('active-content');
$('.tabs').removeClass('active-tab');
$('this').addClass('active-tab');
$('.tab-content' + '.' + selected).fadeIn('slow');
console.log(selected);
});
});
@stephanielingwood It looks like you're passing the wrong argument to
var selected = $(this).attr('.tabs > class');
The .attr() method should take one of the elements attributes
So here:
<a href="mydomain.com" class="myclass" id="primary-link">something</a>
The attributes of the anchor tag are "href","class" and "id".
_
is in the global scope on lodash.com
~~
which is used as a faster Math.floor
I am using this so when you click on one image another appears in its place and then clicking on the new one brings in another new one.
$(".image").click(function(){
$(this).next().addClass("image").removeClass("noImage")
$(this).removeClass("image").addClass("noImage")
})
for some reason it is only working the first time. It seems like it should keep working because each new image is taking on the image class so it should respond to the next click, or thats what I thought.