Pergunta


I'm using isotope ( http://isotope.metafizzy.co ) with expandable items, and i would like to use ScrollTo so that i can automatically scroll to the newly expanded item..

I first tried to use the callback with the reLayout method, something like:

container.isotope('reLayout', iwannascroll(origin));

function iwannascroll(origin_with_newpos){
    $.scrollTo(origin_with_newpos, 800);                
}

origin being a variable where i put "this" from the click handler.
Unfortunately, i always get the old position of the object..

Actually i'm not sure if the callback is called too soon or if i'm unable to understand how storing my jQuery object makes it more like a copy or a "pointer" ;-)

Any thought ?

EDIT : i am now sure that the callback is called before the end of the animation, so my question would be : how can i now the animation has finished ?

Nenhuma solução correta

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top