window.onscroll = function() {
var scroll = $(document).scrollTop();
if (scroll >= $(document).height() - $(window).height()){
$('.sidebar').addClass('sidebar--bottom');
}else{
$('.sidebar').removeClass('sidebar--bottom');
}
}
.sidebar--bottom {
top: auto;
bottom: 500px;
}
<select>
<optgroup >
<option value=""></option>
<option value="strawberries">Strawberries</option>
</optgroup>
</select>