set ID to all of your blocks and create cookie based on IDs. like this:
$('.block').click(function(){
if ( $(this).find('.outer').css('display') == 'block' )
{
$(this).find('.outer').slideUp('normal');
$.cookie($(this).attr('id'), 'hide');
}
else
{
$(this).find('.outer').slideDown('slow');
var tab_cookie = $.cookie($(this).attr('id'));
if ( tab_cookie == 'hide' )
{
$.cookie($(this).attr('id'), 'show');
}
}
});
then use this code:
$(document).ready(function(){
$('.block').each(function(){
var block =$(this).attr('id');
if ( $.cookie(block) == 'hide' )
{
$(this).find('.outer').hide();
}
});
});
update
in your case use this code:
jQuery(function ($) {
$('.toggle-container').each(function () {
var block = $(this).attr('id');
if ($.cookie(block) == 'hide') {
$(this).find('.toggle-content').hide();
}
else {
$(this).find('.toggle-content').show(); /* show visible element */
}
});
$('.toggle-header').click(function () {
if ($(this).next().css('display') == 'block') {
$(this).next().slideUp('normal');
$.cookie($(this).parent().attr('id'), 'hide');
} else {
$(this).next().slideDown('slow');
var tab_cookie = $.cookie($(this).parent().attr('id')); /* missed parent() here */
if (tab_cookie == 'hide') {
$.cookie($(this).parent().attr('id'), 'show');
}
}
});
});