2A News

District Judge Halts Strict New Jersey Gun Law

Reading Time: 3:2 min

A draconian gun control law signed by New Jersey Gov. Phil Murphy last month is now on hold. U.S. District Judge Renee Marie Bumb on Monday granted a temporary restraining…

View post

Law Banning Handgun Sales to Law-Abiding Adults Under 21 Struck Down

Reading Time: 3:13 min

The Fourth Circuit Court of Appeals ruled last week that the federal ban on handgun sales to those aged 18 to 20 is unconstitutional. The Second Amendment Foundation immediately called…

View post

Firearms Purchases Reach Record Numbers Despite Anti-Gun Mania

Reading Time: 3:11 min

The new year means new laws against our guaranteed Second Amendment rights, but even the best efforts by lawmakers to curb gun ownership have not slowed Americans’ rush to defend…

View post

Federal Appeals Court Strikes Down Bump Stock Ban

Reading Time: 3:3 min

A federal appeals court on Friday struck a blow against gun control advocates when it struck down the ban on bump stocks. These are firearm accessories that enable an increased…

View post

Dollar General Employee Incredibly Charged With Manslaughter For Defending Business

Reading Time: 2:49 min

A Dollar General employee was inexplicably charged with manslaughter after shooting and killing an alleged armed robber at a Louisiana store. In the affidavit of probable cause filed with the…

View post

House Passing “Assault Weapons Ban” Just Admitted They Want to Defy The Supreme Court

Reading Time: 1:48 min

During the AR-15 Ban hearing, or as they like to deceitfully mislabel it, the “Assault Weapons ban” hearing, the Democrat politicians in the House made it clear they wanted 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>