2A News

Tuscaloosa Woman Shoots Alleged Attacker While on Phone With 911

Reading Time: 1:55 min

Conventional wisdom says that the best way to react to a violent threat is to avoid it in the first place, and that is undeniably true. But what happens when…

View post

2A Groups File Brief Supporting Sig Sauer and Gun Owner Privacy

Reading Time: 1:57 min

A pair of Second Amendment advocates took a stand last week to protect the private information of gun owners. At issue in Hall v. Sig Sauer, Inc., a liability lawsuit…

View post

Alabama Gun Owners May Enjoy Second Amendment Sales Tax Holiday

Reading Time: 1:57 min

While some states continue to launch attacks on fundamental Second Amendment rights, Alabama is a leader in defending the ability to keep and bear arms.  That includes the right to…

View post

Bill to Restore Young Adults’ Rifle and Shotgun Rights Stymied in Florida Senate

Reading Time: 1:58 min

Legislation to restore Second Amendment rights for Florida’s young adults ran into an unexpected roadblock last week.  State lawmakers who support the right to keep and bear arms are busy…

View post

NRA Files 3rd Lawsuit Against NFA Registration Requirement

Reading Time: 1:60 min

The venerable National Rifle Association (NRA) announced last week the filing of a third lawsuit challenging the controversial National Firearms Act of 1934 (NFA). There has doubtlessly been progress on…

View post

Georgia Lawmakers Attempt to Strengthen State’s ‘Stand Your Ground’ Law

Reading Time: 2:5 min

Georgia is not the first state that comes to mind when considering where Second Amendment rights need to be enhanced, but it is on the list. For all the pro-gun…

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>