2A News

GOA Blasts Arrest of NBA Star on Gun Charge in Texas

Reading Time: 1:56 min

Even in Texas of all places, there is still work to be done. This was evident early Saturday when Cleveland Cavaliers star James Harden was arrested in Houston on a…

View post

Senate Bill Would Repeal Prohibition of Federal Gun Registry

Reading Time: 2:2 min

A proposal in the U.S. Senate intends to repeal the Tiahrt Amendment, which is solely responsible for thwarting anti-gunners’ dreams of a national firearm registry. Sen. Andy Kim (D-NJ) introduced…

View post

Nebraska Senate Hopeful Wants Mental Evaluations for AR-15 Owners

Reading Time: 1:56 min

Admittedly, there are some states, California, New York, and now Virginia, that come to mind where a political candidate can whip up support for ideas that clearly infringe on Second…

View post

Federal Court Vacates ATF’s ‘Engaged in the Business’ Rule

Reading Time: 2:5 min

The Bureau of Alcohol, Tobacco, Firearms, and Explosives (ATF) may need to retrain agents considering multiple court rulings and changes at the Department of Justice (DOJ). Late in the last…

View post

Gunmaker Abandons Virginia for Greener Pastures in Georgia

Reading Time: 2:9 min

There should be penalties for states that run roughshod over Second Amendment rights, but litigation can take years, and there’s always the chance that anti-gunners will prevail. There is, however,…

View post

Armed Nashville Barbershop Customer Survives Foolish Threat

Reading Time: 1:60 min

Barber shops are a hub of activity in many communities, and often they are filled with old men waiting on a haircut and shave. What they are not supposed to…

View post
<script>
  /*Source: https://github.com/Krzysztof-Antosik/Two-direction-Sticky-Sidebar*/
  
  // Verificar el ancho de pantalla al cargar y redimensionar
  function checkScreenWidth() {
    if (window.innerWidth <= 767) {
      // Si la pantalla es menor o igual a 676px, no ejecutar el código
      return;
    }

    const stickyElement = document.querySelector('.fb-sidebar__aside');
    const startPosition = stickyElement.getBoundingClientRect().top;

    let endScroll = window.innerHeight - stickyElement.offsetHeight - 500;
    let currPos = window.scrollY;
    let screenHeight = window.innerHeight;
    let stickyElementHeight = stickyElement.offsetHeight;
    let topGap = 40;
    let bottomGap = 40;

    setTimeout(() => {
      if (stickyElement.hasAttribute('data-top-gap')) {
        const dataTopGap = stickyElement.getAttribute('data-top-gap');
        topGap = dataTopGap === 'auto' ? startPosition : parseInt(dataTopGap);
      }

      if (stickyElement.hasAttribute('data-bottom-gap')) {
        bottomGap = parseInt(stickyElement.getAttribute('data-bottom-gap'));
      }
    }, 100);

    stickyElement.style.position = 'sticky';
    stickyElement.style.top = `${topGap}px`;
    stickyElement.style.height = 'fit-content';

    function positionStickySidebar() {
      endScroll = window.innerHeight - stickyElement.offsetHeight - bottomGap;
      const stickyElementTop = parseInt(stickyElement.style.top.replace('px', ''));

      if (stickyElementHeight + topGap + bottomGap > screenHeight) {
        if (window.scrollY < currPos) {
          if (stickyElementTop < topGap) {
            stickyElement.style.top = `${stickyElementTop + currPos - window.scrollY}px`;
          } else if (stickyElementTop >= topGap && stickyElementTop !== topGap) {
            stickyElement.style.top = `${topGap}px`;
          }
        } else {
          if (stickyElementTop > endScroll) {
            stickyElement.style.top = `${stickyElementTop + currPos - window.scrollY}px`;
          } else if (stickyElementTop < endScroll && stickyElementTop !== endScroll) {
            stickyElement.style.top = `${endScroll}px`;
          }
        }
      } else {
        stickyElement.style.top = `${topGap}px`;
      }
      currPos = window.scrollY;
    }

    function stickyElementToMe() {
      stickyElement.style.top = `${topGap}px`;
    }

    function updateSticky() {
      screenHeight = window.innerHeight;
      stickyElementHeight = stickyElement.offsetHeight;
      positionStickySidebar();
    }

    setTimeout(() => {
      window.addEventListener('resize', () => {
        currPos = window.scrollY;
        updateSticky();
      });

      document.addEventListener('scroll', updateSticky, {
        capture: true,
        passive: true
      });
    }, 1000);
  }

  // Verificar el ancho de pantalla al cargar y redimensionar
  window.addEventListener('load', checkScreenWidth);
  window.addEventListener('resize', checkScreenWidth);
</script>