Improved scrollTo method. Still not quite there...
This commit is contained in:
parent
eb57544518
commit
359dc8736a
1 changed files with 3 additions and 3 deletions
|
@ -1687,10 +1687,10 @@ Contacts={
|
|||
},
|
||||
scrollTo:function(id){
|
||||
var item = $('#contacts li[data-id="'+id+'"]');
|
||||
console.log('scrollTo, found item '+id+'? ' + item.length);
|
||||
if(item) {
|
||||
if(item && $.isNumeric(item.offset().top)) {
|
||||
console.log('scrollTo ' + parseInt(item.offset().top));
|
||||
$('#contacts').animate({
|
||||
scrollTop: item.offset().top-40}, 'slow','swing');
|
||||
scrollTop: parseInt(item.offset()).top-40}, 'slow','swing');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue