
Here's a lil' Scrollbar Experiment. It's pretty.
-
'lil messages by Mr Speaker
RT @Sadache: It really upsets me when the first question someone asks is, can I mock it? Would you mind knowing what it does first? What ... »
If it's less than 4 degrees in the kitchen, is it ok to leave the fridge door open? »
Ooh, it's a balmy -6.4 degrees this morning in Paris. Luckily I grew a beard in preparation. »
-
A book by Mr Speaker (and Mr Sharkie)
3 Comments
You clearly have too much time on your hands. Extremely cool.
In your code I noticed you used a funtion name “~~()”. Can you explain what this function does and if it is a part of the core Javascript language.
Thanks
That’s just a lil’ trick: the ~ is JavaScript’s bitwise NOT operator. Applying it twice (NOT NOT) is just a cheeky way of doing a Math.floor for positive numbers. But it’s waaaay faster than “Math.floor” (and just slightly faster than “<<0″)
Though in this case, speed is not really an issue and I should have just done Math.floor for readability. Sorry 'bout that!
Post a Comment