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