更新时间:2023-01-30 13:18:32
You should use change
event.
var body = $('html, body');
$('.country-list').on("change", function () {
// make sure, the val() is not empty:
if($(this).val()){
body.animate({
scrollTop: $('#'+$(this).val()).offset().top - 63
}, 'slow');
}
return false;
});