I have a select option tag with a scrollbar to view the contents in the dropdown. I am looking for a way to automatically position the scroll at the bottom when an item is selected from the dropdown.
jquery code
$('document').ready(function(){
$('#textin1').click(function() {
var pos = $('#textin1').offset();
pos.top += $('#textin1').width();
$('#dropdown').fadeIn(100);
$('#dropdown').scrollTop($('#dropdown').find('li:contains("'+$('#textin1').val()+'")').position().top);
return false;
});
$('#dropdown li').click(function() {
$('#textin1').val($(this).text());
$('#dropdown li').removeClass('selected');
$(this).addClass('selected');
$(this).parent().fadeOut(100);
});
});