Employment Law Questions? Ask an Employment Lawyer.
That's depends entirely on the contract. Most contracts require that you follow the wording the contract in terms of breaking it. Just because you may have a better position to go to, that doesn't mean that you can just breach the contract.
If the contract requires a specific amount of notice, then you have to give that amount of notice or you are in breach and can be sued for damages.