robert-o
11/19/2015 - 5:04 PM

Using a select to scroll to on th epage

Using a select to scroll to on th epage

$('#item-select').on('change', function(){
	    var theAnchor = $('#'+$(this).val()).offset().top - 120;
	    $('html, body').animate({
	        scrollTop: theAnchor
	    });
	});
<select name="item-select" id="item-select">
  <option>Select Country</option>	
  <option value="1">1</option>
	<option value="2">2</option>
	<option value="3">3</option>
</select>