The intense, irrational and persistent fear heights or being close to tall buildings is called batophobia and is different from bathophobia which is the fear of depth.
The exact cause of this fear is largely unknown but may be caused by an obsessive behavior causing one to fear heights or being close to high buildings. Some might have gone up a tall building and looked down from above and found themselves suddenly frozen and extremely scared that he or she might fall down and die. Those who fear being close to high buildings might have developed this fear because of seeing a building collapse in an earthquake for instance and having people trapped under the structure thus triggering the fear.
People with this fear usually prefer to live in one-storey houses, without stairs or elevations, and may even get scared of being on top of a stage. They will exhibit symptoms of anxiety when they are in a city with tall buildings and they might feel trapped or suffocated.
Treatment includes behavioral therapy. For severe cases, medications might help especially heights cannot be avoided.