install bootstrap 4.6.0 code example
Example: bootstrap 4.6
$('[data-spy="scroll"]').each(function () {
var $spy = $(this).scrollspy('refresh')
})
$('[data-spy="scroll"]').each(function () {
var $spy = $(this).scrollspy('refresh')
})