2A News

Mom Allegedly Catches Man Under 13-Year-Old’s Bed, Charged with Murder

Reading Time: 4:12 min

As cautionary tales go, the ordeal a Memphis mother faces after shooting an adult suspect she allegedly found under her young daughter’s bed should be a warning for every law-abiding…

View post

Hawaii Supreme Court Embarrasses Itself with SCOTUS Tirade

Reading Time: 2:17 min

Hawaii’s anti-Second Amendment leaders got a wakeup call last month when the U.S. Supreme Court struck down the state’s “vampire rule.” The 6-3 majority concluded that it is unconstitutional to…

View post

‘Historic Victory’ as Appeals Court Strikes Down NJ AR-15 Ban

Reading Time: 3:35 min

Say it louder for those in the back of the room: “The days of arbitrary and politically motivated firearm bans are waning, and the Second Amendment community will not rest…

View post

NJ Officials Bankrupted Two 2A Pennsylvania Businesses, Still Suing Former Owner

Reading Time: 2:1 min

The military strategy of “bombing the ashes” to ensure the enemy is thoroughly destroyed is not one that state and local governments should regularly emulate. However, this appears to be…

View post

DOJ No Longer Defends USPS Gun Carry Prohibition

Reading Time: 2:3 min

The notable victory over the long-standing federal ban on possessing lawful weapons in a U.S. Post Office building won last September by the Second Amendment Foundation (SAF), the Firearms Policy…

View post

Reps Introduce Bill to Safeguard Gun Rights on Federal Lands

Reading Time: 1:60 min

While the shooting community celebrates undeniable recent progress on national gun rights issues, the battle remains far from over. On Thursday, two U.S. representatives introduced the Federal Lands Lawful Carry…

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>