Nor sure which OS you have, but for Yosemite (OS 10.10.0 or 10.10.1 or 10.10.2), go to System Preferences, click on where it says "Dock", and then see if the option "Automatically hide and show the Dock" is clicked on (that is, check mark in its box). If it is, uncheck it. Not sure if that's the reason why you are having issues, but I certainly don't have that problem, and that box is not checked.