Fetching details from the dictionary...

to cross (e.g. road); to traverse
猫が急に道を横ぎって車が止まった。
A cat suddenly crossed the road and the car stopped.
橋を横ぎると美しい公園が見える。
You can see a beautiful park after crossing the bridge.
不安な考えが頭を横ぎって眠れない。
Anxious thoughts cross my mind and I can't sleep.