bootstrap 4.0.0 library code example
Example 1: bootstrap 4.6
$('[data-spy="scroll"]').each(function () {
var $spy = $(this).scrollspy('refresh')
})
Example 2: bootstrap 4.0
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">