Result of offset().top returning wrong value in Safari

Result of offset().top returning wrong value in Safari

Using WordPress Twenty Fourteen theme, edited to add a banner image, the menu bar is supposed to scroll until reaching the top of the page, then stick.

In Safari 7 (Mac) alone among my browsers, the menu bar jumps to the top of the page after scrolling a very little. If you have Safari 7, you can see the odd effect here:

Using the dev tools I traced it to this code (in functions.js):
  1. mastheadOffset = $('#masthead').offset().top - toolbarOffset;
The value of toolbarOffset is zero. But the value of mastheadOffset computes to:
  1. In Chrome and Firefox: 222
  2. In Safari 7.1 (Mac) : 24
This WordPress theme also uses jQuery-Migrate.js in addition to jQuery 1.11.1.

I don’t see this issue raised in this forum, so I am perplexed. Any clues gratefully received. Thanks.
-- Cordially, David