2A News

In the Line of Duty — 2022 a Deadly Year for Law Enforcement

Reading Time: 2:53 min

2022 was a particularly dangerous year to have a decidedly dangerous job. The National Fraternal Order of Police (FOP) reports that 331 police officers were shot last year, and 62…

View post

New Jersey Homeowner Fires Shot and Scares Away Car Thief

Reading Time: 3:6 min

A homeowner in Roseland, New Jersey, put an end to a home break-in and attempted car theft on Monday when he produced a legally owned weapon and fired a shot.…

View post

Armed Iowa Mother Dramatically Stops Kidnapping Attempt

Reading Time: 3:19 min

An armed Iowa mother drew her concealed weapon and courageously stopped two kidnappers who were trying to take her son, according to Des Moines police. The frightening incident unfolded on…

View post

Biden’s ATF Says Gun Owners Have 120 Days To Comply With New Pistol Brace Ruling

Reading Time: 3:5 min

In a setback for lawful gun owners, the Bureau of Alcohol, Tobacco, Firearms, and Explosives (ATF) on Friday posted its final rule on stabilizer braces. The agency said that individuals…

View post

Illinois Sheriffs In Over 80 Counties Refuse to Enforce State So Called Assault Weapon Ban (See Statements)

Reading Time: 6:40 min

Sheriffs across Illinois in over 80 Counties have taken a stand against the state’s ban on semiautomatic weapons, refusing to enforce the new law despite an explicit threat from the…

View post

Armed Customers Stop Panty-Clad Robbery Attempt

Reading Time: 3:10 min

An alleged armed robber bit off more than he could chew Monday when he attempted to rob a Gilmer County, Georgia, convenience store. As it turned out, all three of…

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>