I am looking to create a dynamic scrollable content feature.
Initially, I retrieve the data and set the content as follows:
$("#sub_menu li").on("click", function () {
$("#gallery").html(get_html($(this).attr("id")));
$("#gallery").css("overflow-y", "scroll");
});
The issue arises when new content is added but the scrollbar does not update automatically; it remains at the original height. How can I ensure that the scrollbar updates accordingly when new content is added to a scrollable div?
I want to use a custom scrollbar plugin, but I'm facing difficulties getting it to work after updating the content.
Below is the CSS for the gallery:
#gallery {
width: 530px;
float: right;
height: 660px;
}
To see a demo, click on "Summer 2016" at this site:
kotechweb.com/new_focus/page/inspiration