Closed LamineKessoum closed 6 years ago
You could simply trigger a window resize or scroll event, which in turn repositions the sidebar. Something like this:
$("#parent").on('click', '#mybutton', function() {
$(window).trigger('resize');
});
Let me know if it works.
Update: Problem Resolved after setting a timeout
$("#mybutton").on('click', function() { settimeout(function(){$(window).trigger('resize')},150)});
Hi there, i want to recalc the height of sidebar when i have a click event, the recalc is automatically on resize and scroll events, and because i have a hidden content showed when click on button and that's make a changes on sidebar height. is there any way to recalc the when clicked on button ? something like
$("#parent").on('click', '#mybutton', function(){ $("#mysidebar").trigger( /* recalc height */ ); } );
Thanks guys.