If you've had this symptom for more than an hour or so, then you'll need to perform a manual off/on. Hold down the power button on the iMac for three to four seconds; this should shut your system down, and the Apple logo will disappear. Let go of the power button, wait a couple of seconds, and press the power button again; this will turn it back on.
See if it starts up completely. If not, let us know, or call Apple if you're still within the warranty period or have AppleCare.