2A News

Marine Vet Seizes Pistol and Holds Off Four Alleged Attackers

Reading Time: 2:8 min

As the fundamental factor in real estate is location, the prime objective of violent criminals should be to choose the correct targets. In a recent case that exploded in Oxon…

View post

California Homeowner Shoots Alleged Intruder Wielding Shotgun

Reading Time: 2:3 min

It is said that the only thing a professional sniper fears is another professional sniper. For violent criminals, it’s past time they realized and responded to the tens of millions…

View post

AG Declares Florida’s 3-Day Waiting Period Unconstitutional

Reading Time: 1:56 min

Another day, another win in the ongoing and fierce battle to protect Second Amendment rights from those who would destroy them. After Florida lawmakers enacted a 3-day waiting period for…

View post

Virginia Residents Race to Beat AR-15 Ban 

Reading Time: 3:43 min

The National Shooting Sports Foundation (NSSR) releases monthly adjusted FBI figures on NICS background checks for gun purchases, both raw and adjusted to exclude permit applications and other non-retail functions.…

View post

NSSF Announces Challenge to Connecticut Gun Ban

Reading Time: 2:7 min

The firearm industry trade association, the National Shooting Sports Foundation (NSSF), announced that the group will challenge Connecticut’s new ban on striker-fire handguns, which are nearly ubiquitous in the shooting…

View post

Firearm Sales Strong in May as NFA Checks Explode

Reading Time: 1:48 min

The public’s appetite for the most advanced and safest firearms did not dissipate in May, according to the National Shooting Sports Foundation (NSSF). Adjusted retail sales numbers showed another increase,…

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>