Keep your eye out for Mr Speaker and @twalve's frightfully good book, jQuery: Novice to Ninja - in stores NOW!

Sine Scrollbars

Sine Scrollbars
Here’s a lil’ Scrollbar Experiment. It’s pretty.

3 Comments

  1. Simon Miller wrote:

    You clearly have too much time on your hands. Extremely cool.

    Monday, January 18, 2010 at 7:27 pm | Permalink
  2. SAHarvey wrote:

    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

    Friday, January 22, 2010 at 4:32 pm | Permalink
  3. Mr Speaker wrote:

    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!

    Friday, January 22, 2010 at 4:46 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*
Captcha! Please type 'lolz' *