I have a problem, and try it to solve two more days. Try do it like this:
$.when( $(document).ready ).then(function func_fold () {
$( "#collapsible_sidebar" ).addClass('folded');
})
And like this:
$(document).ready(function func_fold () {
$( "#collapsible_sidebar" ).addClass('folded');
})
And like this too:
$(document).ready(function() {
$( "#collapsible_sidebar" ).addClass('folded');
})
Try .hide()
to see work selector at all, and it doesn't work too. But when I open DOM, I can see this element and this ID.
Warning! I think it important, this div is added to DOM by AJAX.
HTML element:
<div id="collapsible_sidebar"><?php dynamic_sidebar( 'sidebar-1' ); ?></div>