Ah, I remember those... I used to be ridiculously good at them (could usually solve it within a minute). I can't remember there being an actual "trick", other than doing it enough times to know exactly how sliding the pieces around will affect every other piece. You have to learn how to temporarily move a piece (or several) out of the way (but keeping them in order), so that you can move other pieces in their order and slide them back to where they belong.