2A News

Miami Gardens Homeowner Shoots Alleged Intruder Who Opened Bedroom Door

Reading Time: 1:51 min

An apparent daytime home invasion attempt in Florida did not go as planned as the resident’s use of a firearm injured one suspect and sent the other two on a…

View post

Armed Chicago Man Fires on Alleged Car Thief Who Attempted to Run Him Down

Reading Time: 1:51 min

Chicago’s crime dilemma has been in the national spotlight for weeks, and an explosive incident early Sunday morning is a stark reminder of just how dangerous the Windy City can…

View post

Massachusetts High Court Rejects Murder Conviction of Man Who Defended Himself

Reading Time: 2:3 min

Massachusetts is not known as a bastion of gun rights, and the state Supreme Judicial Court has a checkered history of not respecting the Second Amendment. That’s why this week’s…

View post

Federal Court Vacates Order That 2A Organization Hand Over Member Rolls

Reading Time: 1:50 min

A recent U.S. District Court ruling that riled many gun rights advocates was vacated after decisive action from Second Amendment groups and the Department of Justice (DOJ). In deciding Reese…

View post

National Reciprocity Gains Traction in Washington

Reading Time: 3:26 min

The U.S. is a sometimes unworkable patchwork quilt of 50 individual states with their own ideas concerning the Second Amendment. While some citizens are fortunate to reside and travel in…

View post

Good Neighbor Grabs Firearm and Rushes to the Rescue

Reading Time: 1:54 min

Imagine hearing gunshots coming from a neighbor’s residence at night—what would you do? Many would ignore it, hoping it was just a car backfiring. Some would call 911 and report…

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>