2A News

RI Lawmaker Endorses ‘Police Power’ to Confiscate AR-15s

Reading Time: 1:55 min

Rhode Island’s anti-gunners last year successfully pushed through a ban on popular sporting rifles, including the ubiquitous AR-15. To make the move more acceptable, lawmakers “grandfathered” citizens who already owned…

View post

War Hero’s Lawsuit Over Improper Firearm Arrest Tossed

Reading Time: 2:27 min

A patriot who saved the lives of fellow soldiers from a suicide bomb attack in Afghanistan in 2012 deserves far better than the treatment Raffique Khan suffered at the hands…

View post

Kentucky Teenager Fatally Shoots Mother’s Alleged Attacker

Reading Time: 2:15 min

A Kentucky teenager suddenly found himself having to defend his mother from an alleged violent attack on Friday evening. The presence of a ready firearm and the young man’s courage…

View post

Report: DOJ Prepares to Fight Anti-2A State Laws

Reading Time: 3:32 min

It’s a good day for gun owners when the Department of Justice (DOJ) is on the Second Amendment’s side, and a new report offered encouraging news about the battle to…

View post

Canada’s ‘Buyback’ Ends With a Whimper, Now Comes Confiscation

Reading Time: 1:52 min

The March 31 deadline imposed by Canadian anti-gunners for gun owners to tell the government about what firearms they own in preparation for confiscation sailed by last week. And the…

View post

SCOTUS Rejects Challenge to Illinois’ Public Transit Carry Ban

Reading Time: 1:54 min

In a setback for opponents of arbitrary carry restrictions, the U.S. Supreme Court on Monday turned away Schoenthal v. Raoul. This left a lower court ruling in place that upheld…

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>