views:

190

answers:

0

Hello All, Begginer in javascript, I'm trying to make a system tabs. All work fine, but when i want a tab with moveable content (in this exemple, i tried with a accordion), the height container div don't resize to child content.

$(document).ready(function() {

//Tabs init

$('#mask').css({'height':$('#panel-1').height()});

$('a[rel=panel]').click(function () {

    var panelheight = $($(this).attr('href')).height();

    $('a[rel=panel]').removeClass('selected');

    $(this).addClass('selected');

    $('#mask').css({'height':panelheight}); 

    $('#mask').scrollTo($(this).attr('href'), 500);     

    return false;
});

//Accordion init

$(".toggle_container").hide(); 

$("h2.trigger").click(function(){

$(this).toggleClass("active").next().slideToggle(300);  

   }); 
});