I have some jQuery running on a page so the sidebar travels down the screen as the user scrolls. Here is the code that does that:-

Code:
$(window).resize(function() {
    if ($(window).width() > 800) {

        if (!!$('aside.scroll').length) { // make sure "#sticky" element exists
          var el = $('aside.scroll');
          var stickyTop = $('aside.scroll').offset().top; // returns number
          var footerTop = $('footer').offset().top; // returns number
          var stickyHeight = $('aside.scroll').height();
          var limit = footerTop - stickyHeight - 20;
          $(window).scroll(function(){ // scroll event
              var windowTop = $(window).scrollTop(); // returns number

              if (stickyTop < windowTop){

                 el.css({ position: 'fixed', top: -22 });
                 $('aside.scroll').css('margin-top','20px');

              }
              else {
                 el.css('position','relative');
                 $('aside.scroll').css('margin-top','0px');
              }

              if (limit < windowTop) {
                  var diff = limit - windowTop;
                  el.css({top: diff});
              }     
            });
       }
       // Search tabs for mobile
       $('.content').hide();
        $('#tab1.content').show();
        $('#selectField').change(function () {
            $('.content').hide();
            $('#'+$(this).val()).show();
        });
    }
}).resize(); // This will simulate a resize to trigger the initial run.
Then on the right hand side of the screen I have a slide toggle button to show or hide more text. This once opened stops my traveling sidebar from working. Anyone know a way around this?