Skip to content

Commit 5ff3c09

Browse files
authored
Merge pull request #7621 from readthedocs/davidfischer/ad-display-when-scrolled
Display sidebar ad when scrolled
2 parents 6919611 + 09f4d6c commit 5ff3c09

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

readthedocs/core/static-src/core/js/doc-embed/sponsorship.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function create_ad_placement() {
5656
// If this is off screen, instead create an ad in the footer
5757
element = $("<div />").appendTo(selector);
5858
offset = element.offset();
59-
if (!offset || offset.top > $(window).height()) {
59+
if (!offset || (offset.top - $(window).scrollTop()) > $(window).height()) {
6060
if (rtd.is_rtd_like_theme()) {
6161
selector = $('<div />').insertAfter('footer hr');
6262
class_name = 'ethical-rtd';

0 commit comments

Comments
 (0)