Ususally this happens before greying out.
Mine was like that too. When I powered off the device and back on, the wifi button was greyed out.
This wouldn't hurt to try, too. I have fixed one 4S wifi doing it:
1. Download the same iOS firmwire file you are currently using from apple.com
2. Turn off your device for a couple of hours. Let it naturally cool down. (2-3 hours)
3. Turn on the device. At this point for many people their wifi status should improve from "greyed out" to "not finding any networks"
4. Perform iOS restore via itunes by holding Shift and clicking on the Restore button. So that you can browse for the file you had previously downloaded and perform the iOS restore.
Just make sure you have backed up your device before performing a restore.
If this worked for you, I recommend you to take following actions afterwards:
- Reduce your screen brightness in order to limit the heat generated by the screen
- turn off the wifi button whenever you don't require it
- use your mac or laptop pc to charge your iphone whenever possible. Connecting it to a power outlet will make it generate more heat.