I actually saw that on Google somewhere but it looks too long winded. As long as it's as quick as a built-in jQuery function then I'm fine. Is it as quick? I have no idea.
Is there a quicker way at all?
I don't want to implement something for this that will slow the initial load down.