I think it is the proximity camera flex, First of all hold power and home button for 15 seconds to reset. If this still persists: Open up the iPhone and disconnect the 3 flex cables from the motherboard, re-sit them and then turn your phone on again. hope this helps.
This method that worked for me. My issue was the Iphone 5s screen glitching especially at the 2 sides of the screen. ** Plug your phone into a power source with the lightning cable ** Turn the screens brightness down to MINIMUM all the way down. ** Wait at least 30 mins for it to recover itself If this doesn't work, keep the phone plugged in and turn it off and wait another 30 mins. this has happened to me twice now and these methods had worked for me.