Floor panels are shown, which are provided with a vertical folding locking system on short edges that only locks vertically and a mechanical locking system on long edges that prevents displacement along the long edges. A locking system for primarily rectangular floor panels with long and short edges installed in parallel rows, which allows that the short edges may be locked to each other with a vertical movement without a horizontal connection and that such horizontal connection is accomplished by the locking system on the long edges including a first and second horizontal locking perpendicular to the edges and along the edges.