I have a function that creates a button and toggles a div.
I would like this div to be togled on or off based on a cookie value. the cookie is updated each time this is toggled. The initial value is the cookie value.
If no cookie is present, one is created with initial value of 'true'. The cookie is_side_toggled is a boolean.
function addRightButton() {
$('.fc-header-right').html
('<a class="btn btn-small btn-unscheduled">>></a>');
if ($('#cal-side').is(":visible")) {
$('.btn-unscheduled').html('>>');
}
else {
$('.btn-unscheduled').html('<<');
}
$('.btn-unscheduled').on('click', function () {
$('#cal-side').toggle();
if ($('#cal-side').is(":visible")) {
$('.btn-unscheduled').html('>>');
}
else {
$('.btn-unscheduled').html('<<');
}
resizeCalendar();
})
}
How could I add a bool cookie and get its value?
Thanks