<commit_before>module.exports = function(el) {
  //Had to grab the width & vertical position off the original
  //to stop it popping to the windows width when position was changed to fixed
  var orgElementPos = $('.attorneyBanner').offset(),
  orgElementTop = orgElementPos.top,
  widthOrgElement = $('.attorneyBanner').width();

  //Banner pops out the DOM so this makes sure the content below doesn't shift up
  $('#heightHolder').css('height', $('#heightHolder').height());

  //Run the function to reposition the banner
  setInterval(stickIt, 100);

  function stickIt() {
    if ($(window).scrollTop() >= (orgElementTop)) {
      // scrolled past the original position; change the position to fixed.
      $('.attorneyBanner').css('position', 'fixed').css('width', widthOrgElement).css('top', '0px');
    } else {
      //Returns the banner to the DOM once we scroll up
      $('.attorneyBanner').css('position', 'relative');
    }
  }
}<commit_msg>DDCNFF-813 Generalized the JS<commit_after>module.exports = function(el) {
  //Had to grab the width & vertical position off the original
  //to stop it popping to the windows width when position was changed to fixed
  //ADD THE DATA-FOCUSES TAG TO YOUR ELEMENT WITH ITS OWN ID IN IT
  var bannerId = $('[data-focuses]').attr('data-focuses'),
  idOfBanner = $('#' + bannerId),
  orgElementPos = idOfBanner.offset(),
  orgElementTop = orgElementPos.top,
  widthOrgElement = idOfBanner.width();

  //Banner pops out the DOM so this makes sure the content below doesn't shift up
  //You need a containing element around the floating element!
  idOfBanner.parent().css('height', idOfBanner.parent().height());

  //Run the function to reposition the banner
  setInterval(stickIt, 100);

  function stickIt() {
    if ($(window).scrollTop() >= (orgElementTop)) {
      // scrolled past the original position; change the position to fixed.
      idOfBanner.css('position', 'fixed').css('width', widthOrgElement).css('top', '0px');
    } else {
      //Returns the banner to the DOM once we scroll up
      idOfBanner.css('position', 'relative');
    }
  }
}
{'fraction_non_alphanumeric': 0.1339667458432304, 'fraction_numerical': 0.005225653206650831, 'mean_word_length': 3.8192219679633865, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6878381', 'n_tokens_mistral': 636, 'n_tokens_neox': 597, 'n_words': 211}