Fixes #507. Small copy-and-paste from SO, with attribution.
Merge pull request #574 from afred/tab-links-507

Make tab click change url