Skip to content

Commit 55044e7

Browse files
author
Swaagie
committed
[fix] set offset to zero not scroll
1 parent 2e84a8d commit 55044e7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

client.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ pipe.once('package.json:render', function render(pagelet) {
1111
* @api private
1212
*/
1313
placeholders.on('click mouseover', 'pre a:not(.trigger)', function guide() {
14-
var scroll = $(document).scrollTop()
15-
, offset = scroll - guides.parent().offset().top;
14+
var offset = $(document).scrollTop() - guides.parent().offset().top;
1615

1716
guides.hide();
1817
placeholders.find('#'+ this.href.split('#').pop().replace('.', '\\.'))
19-
.css('top', (offset < 0 ? scroll : offset) +'px')
18+
.css('top', (offset < 0 ? 0 : offset) +'px')
2019
.show();
2120
});
2221

0 commit comments

Comments
 (0)