Hi Paul
Cooking onions is one of the more difficult things to master, seriously. If you think about it no two onions are ever really the same, they all have different water contents, natural sugars etc, depending on the type, time of year, time in storage, place of origin etc, etc,.
It also makes a difference how the onion is sliced. Think of the root end and the pointed end as poles then for frying they should be sliced longitudinally, from pole to pole, I've no idea why this is but it works.
There's no real substitute for practice but cooking onions remains a 'black art' and I think cookery books just gloss over the problems or ignore them altogether, probably because the author is no great shakes at cooking the things either. Personally if I see "cook the onions for a few minutes until transparent" in a recipe then I just know the author hasn't got a clue.
Take heart and keep trying but cooking onions properly and repeatedly is one of the more difficult things to master, I've been trying for years but still screw up more often than not.
Hope this helps, regards
CoR.