2A News

Minnesota Governor Considers Emergency Session on Gun Control

Reading Time: 3:24 min

The aftershocks of last week’s horrific shooting at a Minneapolis Catholic school continue to reverberate. While some note the mental health issues surrounding the suspect, others want to focus on…

View post

Alleged Mistress Defends Herself from Enraged Wife

Reading Time: 1:54 min

A deadly early morning shooting in Nashville on Monday led investigators to uncover a love triangle that resulted in the alleged mistress using lethal force to defend herself from the…

View post

2A Groups Petition SCOTUS to Hear Challenge to Cook County’s AR-15 Ban

Reading Time: 2:14 min

Illinois’s most populous county has long prohibited its residents from exercising a right that is not only enjoyed by tens of millions of Americans but also protected by the Second…

View post

Anti-Gunners Blame Inanimate Firearms Rather Than Violent Criminals

Reading Time: 1:54 min

Wednesday’s attack on Catholic schoolchildren by a lunatic in Minneapolis shook the nation and should have brought a renewed focus on the mental health crisis gripping the country. Instead, it…

View post

California Concludes Microstamping Technology for Ammunition is Now Viable

Reading Time: 3:24 min

Two years after abandoning a program to microstamp ammunition due to a lack of feasibility, California officials now sing a different tune and are again marching toward a new gun…

View post

NRA Leads Lawsuit Against Massachusetts Ban of Popular Sporting Rifles

Reading Time: 1:52 min

Massachusetts gun owners have long dealt with the oppressive regime of prohibitions and regulations handed down by their state lawmakers. Now, thanks to a powerful legal push by the National…

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>