The motion of a vibrating object is determined by the way it is held. This simple observation has long inspired string instrument makers to create new sounds by devising elegant string clamping mechanisms, whereby the distance between the clamping points is modulated as the string vibrates. At the nanoscale, the simplest way to emulate this principle would be to controllably make nanoresonators slide across their clamping points, which would effectively modulate their vibrating length. Here, we report measurements of flexural vibrations in nanomechanical resonators that reveal such a sliding motion. Surprisingly, the resonant frequency of vibrations draws a loop as a tuning gate voltage is cycled. This behavior indicates that sliding is accompanied by a delayed frequency response of the resonators, making their dynamics richer than that of resonators with fixed clamping points. Our work elucidates the dynamics of nanomechanical resonators with unconventional boundary conditions, and offers opportunities for studying friction at the nanoscale from resonant frequency measurements.