Okay, so I got it working by doing this:
Including my custom jquery code inside the header gives all kind of errors. Now I don't load a jquery library and only my custom jquery code before the body end tag. Now all runs okay.
1. What version of jquery is Sitefinity using? Is it loaded by default?
2. What to do about the not working '~' ? Or am I wrong about this?