PageSourceSearch

https://doahomework.com/js/fixed-sidebar.js

js doahomework.com collected 2026-10-06 15:25:01 UTC 3,527 bytes, 96 lines download raw bytes

1if($('aside').is('.sidebar')){
2    if ($('.content').hasClass("blog-page") || $('.inner').hasClass("lead__inner") || $('div').is(".no-fixed") || $('div').is(".discount__img")){
3        // $socialNet = $('.heateor_sss_vertical_sharing');
4        // var $scrollTop = $(window).scrollTop();
5        // var $headerHeight = $('.header').height();
6        // if($scrollTop <= $headerHeight){
7        //     console.log(1);
8        //     $socialNet.css('top', $headerHeight);
9        // }
10        // $(window).scroll(function(event) {
11        //     var $scrollTop = $(window).scrollTop();
12        //     if ($scrollTop > $headerHeight) {
13        //         console.log(1);
14        //         $socialNet.css('top','110px!important');
15        //     }
16        //     else{
17        //         $socialNet.css('top', $headerHeight + 2);
18        //
19        //     }
20        // })
21    }
22    else{
23        $('.content').addClass('with-sidebar');
24        if($('.cstmr').length){
25            $('.sidebar').addClass('cstmr-sidebar');
26        }else{
27            $('.sidebar').addClass('fixed-sidebar');
28        }
29        $(function() {
30            var $window = $(window);
31            var $sidebar = $(".sidebar");
32            var $sidebarTop = $sidebar.position().top;
33            if (window.location.pathname == "/writing-services/" || window.location.pathname == "/editing/" || window.location.pathname == "/rewriting/" || window.location.pathname == "/proofreading/"){
34                var $footer = $("#calculator-here");
35            }
36            else{
37                if($('section').is(".cta-row")){
38                    var $footer = $(".cta-row");
39                }
40                else{
41                    if ($('section').is(".referral-cta-row")){
42                        var $footer = $(".referral-cta-row");
43                    }
44                    var $footer = $(".footer");
45                }
46            }
47
48            if ($('section').is(".referral-cta-row")){
49                var $sidebarHeight = $sidebar.height() + 80;
50            }
51            else{
52                var $sidebarHeight = $sidebar.height();
53
54            }
55            var $footerTop = $footer.position().top;
56            var $headerHeight = $('.header').height();
57
58            var $scrollTop = $window.scrollTop();
59
60            var $topPosition = Math.max($headerHeight + 40, $sidebarTop - $scrollTop);
61
62            var $topPosition = Math.min($topPosition, $footerTop - $scrollTop - $sidebarHeight );
63
64            if($scrollTop <= $headerHeight){
65                if ($('section').is(".referral-cta-row")){
66                    var $topPosition = $headerHeight + 550;
67                }
68                else{
69                    var $topPosition = $headerHeight + 40;
70                }
71            }
72            $sidebar.css("top", $topPosition);
73
74
75            $window.scroll(function(event) {
76                var $scrollTop = $window.scrollTop();
77
78                var $topPosition = Math.max($headerHeight + 40, $sidebarTop - $scrollTop);
79
80                var $topPosition = Math.min($topPosition, $footerTop - $scrollTop - $sidebarHeight );
81
82                if($scrollTop <= $headerHeight){
83                    if ($('section').is(".referral-cta-row")){
84                        var $topPosition = $headerHeight + 550;
85                    }
86                    else{
87                        var $topPosition = $headerHeight + 40;
88                    }
89                }
90                $sidebar.css("top", $topPosition);
91            });
92        });
93
94    }
95
96}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.