I have a browser resize script:
$(document).ready(function() {
$(window).on('resize', function() {
if ($(this).height() <= 800) {
$('.content').css('max-height', '500px'); //set max height
}
else {
$('.content').css('max-height', ''); //delete attribute
}
}).resize()
})
I want to make the jscrollpane run after the window resizes because that is when I will need the scrollbar. At the current code I have it just shows the regular scrollbar.
$(function() {
$('.scroll-pane').jScrollPane();
});
Is there a way to run this script after the max height script is completed?
1 Answer