2A News

Gun Rights Groups Join Forces to Support Challenge to Switchblade Ban

Reading Time: 3:31 min

The U.S. Supreme Court in 2008’s District of Columbia v. Heller determined that the Second Amendment protects the right to keep and bear arms “in common use.” Subsequent court rulings…

View post

Alabama Break-In Leads to Fatal Shooting by Intended Victim

Reading Time: 1:53 min

An Alabama woman found herself in a desperate and up-close encounter with a career criminal late Sunday night when he allegedly broke into her Decatur residence. Dispatchers reacted quickly when…

View post

Armed Indiana Woman Defends Herself Against Attempted Sexual Assault

Reading Time: 1:59 min

There is little more terrifying than knowing that a defenseless person is under attack. When that person is a woman allegedly targeted by a violent criminal, it is even more…

View post

Alleged NC Robber Wanted Cash, Got Shot in the Foot Instead

Reading Time: 1:57 min

It is ill-advised to attempt to rob a business establishment that was struck by criminals recently. There is a good chance the proprietors upgraded their defense capabilities and are much…

View post

US Gun Sales Surge 2% in September After Seven Months of Decline

Reading Time: 1:49 min

Gun sales skyrocketed to new heights during the pandemic and the social unrest that accompanied it, so it is hardly surprising to see transactions level off from recent peaks. Still,…

View post

Judge Orders Chicago PD to Cease Carrying Sig Sauer P320 Handguns

Reading Time: 2:2 min

A new twist in the saga surrounding the popular Sig Sauer P320 handgun emerged this week. Despite strong denials from the company and a battery of tests, there continue 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>