You don’t need external code to create a sticky shrinking Divi header, it’s easily achievable with the built in settings. Here is a free downloadable template.