We propose a variant of the algorithm by [R. Simson, E. D. Sheets, and K. Jacobson, Biophys. 69, 989 (1995)]. Their algorithm was developed to detect transient confinement zones in experimental single-particle tracking trajectories of diffusing membrane proteins or lipids. We show that our algorithm is able to detect confinement in a wider class of confining potential shapes than that of Simson et al. Furthermore, it enables to detect not only temporary confinement but also jumps between confinement zones. Jumps are predicted by membrane skeleton fence and picket models. In the case of experimental trajectories of mu-opioid receptors, which belong to the family of G-protein-coupled receptors involved in a signal transduction pathway, this algorithm confirms that confinement cannot be explained solely by rigid fences.