Reputation: 873
Here is my code. I want to change the context in right frame when i click the buttons. But these line of codes don't seem like working. I think it is because of selectors, I tried different selectors but it was no use.
$('#web-dash').click(function(){
$(".graphs-dash>div:visible").slideUp('1000', function() {
$("#whole .websitestats").slideDown('1000');
$('#pie').hide();
$('#toShow').val("1");
});
})
$('#skill-dash').click(function(){
$(".graphs-dash>div:visible").slideUp('1000', function() {
$("#whole .skill").slideDown('1000');
$('#pie').hide();
$('#toShow').val("1");
});
})
How can I select #whole .skill
and #whole .websitestats
? I made google searchs about selectors but couldn't solve the problem.
Upvotes: 0
Views: 72
Reputation: 993
Don't know whether I understood your issue correctly.
$("#whole .websitestats").slideDown('1000');
Even after executing above code .websitestats
is not visible. Is this is you problem ?
$("#whole .websitestats")
and $("#whole .skill")
matches the respective elements correctly. But, display:none property is added in #whole div. As parent div is not visible child element also not visible.
Try
$("#whole").show().find(".skill").slideDown('1000');
Upvotes: 1
Reputation: 40639
Try this,
$('#web-dash').click(function(){
$(".graphs-dash>div:visible").slideUp('1000', function() {
$("#whole").find(".websitestats").slideDown('1000');// use find function here
$('#pie').hide();
$('#toShow').val("1");
});
});
$('#skill-dash').click(function(){
$(".graphs-dash>div:visible").slideUp('1000', function() {
$("#whole").find(".skill").slideDown('1000');// use find function here
$('#pie').hide();
$('#toShow').val("1");
});
})
Find Docs http://api.jquery.com/find
Upvotes: 0