The reason Democrats are associated with a donkey is because of a smear campaign against Andrew Jackson!
If you thought modern politics were dirty, you should look back in history. Politics in the United States are full of smear campaigns, backroom deals and other funny business. One of those smear campaigns is responsible for Democrats being associated with donkeys to this day.
When Andrew Jackson was running for President in 1828, his opponents started calling him a jackass in the midst of an intense mudslinging battle between him and his opponents. In 1937, a political cartoon titled "A Modern Balaam and his Ass," (on the right) showed Jackson riding a donkey, representing the Democratic Party.
The imagery was revived in 1870, with a similar cartoon by Thomas Nast in a magazine called Harper's Weekly. This time, the imagery caught on and other cartoonists started using the Donkey as a representation of the Democratic Party. In reality, the Donkey has never been an official symbol of the Democratic Party, although it had been unofficially used before.
Interestingly, Blue being the color for Democrats and Red for Republicans wasn't set until the year 2000. Before 2000, both parties used red, white and blue. However, on Election night 2000, most major television networks used Blue to represent states won by Al Gore and Red to represent those won by George W. Bush. The color association has remained since then. It's a strange reversal compared to other countries that have a mostly 2-party system, in which red is associated with left-wing parties and blue with the right-wing parties.