Hacker News new | ask | show | jobs
by mshenfield 3761 days ago
I made a little experiment, and converted this to a vanilla Javascript library. Relevant to some of the questions below about whether this should use jQuery or not.

Edit: There were two gotchas beyond browser compatibility. jQuery provides a consistent interface to set numeric style values - in vanilla Javascript you have to remember to turn these numbers into strings suffixed with "px". And I hacked together the code that stops fadein and fadeout from stepping on each other.

Changes: https://github.com/fdansv/marginotes/pull/2 Working Example: http://mshenfield.github.io/fdansv.github.io/

1 comments

Looks like you've got a bug when the mouse passes over a link that has no sidenote. To reproduce:

  1. Hover over a link with a sidenote (i.e. "Bill Gates").
  2. Hover over a link without a sidenote (i.e. "unrecognised").
  3. Move your mouse off of the link.
During step 3 the previous sidenote will briefly appear.

(I'm running Chrome 48.0.2564.116 on OS X 10.11.3 if that matters)

Nice catch! My fadeout function mistakenly set the opacity to 1 to start off. Fixed.