Upcoming

How To Make Animated Image on Text Hover Using Elementor Free

Tools and Links Used

Hostinger Fast, beginner friendly WordPress hosting.
Get Hosting
Elementor The free page builder this tutorial is built with.
Get Elementor
Elementor Pro The Pro upgrade used throughout this tutorial.
Get Elementor Pro
Project Files Download the resources used in this tutorial.
Download Files
Kitpapa Ready made Elementor template kits.
Get Templates
Kitninja eCommerce Elementor template kits.
Get Templates

Prompt Used in This Tutorial

Image on Text Hover Style Css
<style>
body {
    overflow-x: hidden;
}

.service-arrow {
  transform: translate3d(-20px, 0px, 0px) scale3d(1, 1, 1);
  transform-style: preserve-3d;
  transition: all 1s ease;
  opacity: 0;
  color: #0056ff;
}

.service-box:hover .service-arrow {
  transform: translate3d(0px, 0px, 0px) scale3d(1, 1, 1);
  opacity: 1;
}

.service-box .service-no .elementor-heading-title, 
.service-box .service-name .elementor-heading-title, 
.service-box .service-arrow .elementor-icon {
    transition: all 0.4s ease;
}

.service-box:hover .service-no .elementor-heading-title, 
.service-box:hover .service-name .elementor-heading-title {
    color: #2563eb;
}

.service-box:hover .service-arrow .elementor-icon {
    color: #2563eb !important;
}



.icon .elementor-icon {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.icon:hover .elementor-icon {
    border-color: #2563eb !important;
}

.service-box {
  position: relative;

}



@media (min-width: 1023px) {
 .service-img {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    z-index: 10;
    will-change: transform;
    top: -90px;
    left: 0;
    transition: all .5s ease-out;
    
  }

 .service-box:hover .service-img {
    opacity: 1;
  }
}

@media (max-width: 1024px){
    .service-img{
         opacity: 1;
     }
}
</style>
Image on Text Hover Style Css Classes
service-arrow
service-box
service-no
service-name
service-img
icon
Image on Text Hover JS Code
<script>
document.addEventListener('DOMContentLoaded', () => {
  const ease = 0.1;

  const initFollowerEffect = () => {
    document.querySelectorAll('.service-box').forEach(box => {
      const follower = box.querySelector('.service-img');
      let posX = 0;
      let mouseX = 0;
      let animationId;

      const updatePosition = () => {
        const diffX = mouseX - posX;
        posX += diffX * ease;

        follower.style.transform = `
          translate3d(${posX}px, 0, 0)
          rotateZ(12deg)
        `;

        animationId = requestAnimationFrame(updatePosition);
      };

      const handleMouseMove = (e) => {
        const bounds = box.getBoundingClientRect();
        mouseX = e.clientX - bounds.left - 50; // small offset
      };

      box.addEventListener('mouseenter', () => {
        const bounds = box.getBoundingClientRect();
        mouseX = posX = bounds.width / 3;

        follower.style.opacity = '1';
        follower.style.willChange = 'transform';
        follower.style.transformStyle = 'preserve-3d';

        box.addEventListener('mousemove', handleMouseMove);
        updatePosition();
      });

      box.addEventListener('mouseleave', () => {
        cancelAnimationFrame(animationId);
        box.removeEventListener('mousemove', handleMouseMove);

        follower.style.opacity = '0';
        follower.style.transform = 'translate3d(0, 0, 0) rotateZ(0deg)';
      });
    });
  };

  // Only apply effect on screens wider than 1024px
  const applyIfWideScreen = () => {
    if (window.innerWidth > 1024) {
      initFollowerEffect();
    }
  };

  applyIfWideScreen();

  // Hook for Elementor dynamically loaded content
  const hookElementor = () => {
    elementorFrontend.hooks.addAction('frontend/element_ready/global', () => {
      if (window.innerWidth > 1024) {
        initFollowerEffect();
      }
    });
  };

  if (window.elementorFrontend) {
    hookElementor();
  } else {
    window.addEventListener('elementor/frontend/init', hookElementor);
  }
});


</script>

Get Your FREE Freelancing Roadmap

Stop hopping between tutorials. Grab the Freelancing Mastery Handbook to learn how to choose a skill, build your foundation, find clients, and confidently start your freelancing journey.

Free eBook Download

Related Tutorials

From learning the right skills to building a stronger digital presence, we help you turn ideas into practical, professional results.

Vibe Code a REAL Animated WordPress Website with Claude + Elementor

21.8K views

View Tutorial

Vibe Coding Full Course for Beginners – Build & Launch a Real SaaS

3.3K views

View Tutorial

Edit Videos with ChatGPT Codex — Raw Clips to Finished Reel

3.4K views

View Tutorial

Browse All Tutorials