2A News

Report: 2A Supporters Challenge Virgin Islands’ Draconian Gun Laws

Reading Time: 2:1 min

How atrocious are gun laws imposed on residents and visitors of the U.S. Virgin Islands? Remember that the Caribbean territory is subject to U.S. law and the Constitution, and American…

View post

Dhillon Predicts SCOTUS Will Legalize AR-15s Nationwide

Reading Time: 1:59 min

Assistant Attorney General Harmeet Dhillon went on the record this week in an interview with Just the News with a prediction that certainly raised eyebrows. The federal official told the…

View post

DOJ Sues Denver and Colorado Over ‘Assault Weapons’ and Magazine Bans

Reading Time: 2:6 min

The new and somewhat improved Department of Justice (DOJ) took a stand on Wednesday, when the historically embattled agency sued the state of Colorado after filing similar litigation against the…

View post

National Gun Sales Increase in April as Virginia’s Soar

Reading Time: 1:54 min

The always-interesting data on firearm and firearm-related sales across the nation are in for April, and they reveal a clear truth. The American public continues to support the Second Amendment…

View post

Man Pays Price for Alleged Break-In at Estranged Wife’s Boyfriend’s Home

Reading Time: 2:6 min

Divorce is a messy business, but the battles should be fought in a courtroom between lawyers. The regrettable choice that some who are going through this trauma decide to take…

View post

Texas Father Shoots Alleged Carjacker to Protect Family

Reading Time: 2:13 min

It was the middle of a likely hot afternoon on Sunday when a Texas family of eight who stopped into a Garland convenience store encountered what would make every good…

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>