How to create followspot effect using HTML CSS and jQuery ? Last Updated : 06 Jul, 2023 Comments Improve Suggest changes Like Article Like Report The follow-spot effect (spotlight effect) is an effect that can be easily implemented using jQuery. The effect is quite popular for the opening or front banner design for any website. Approach: The approach is to use circle CSS on the mouse movement effect using the mousemove() function provided by jQuery. HTML Code: The HTML code is used to design the basic structure of the body. In this section, we will use a <div> tag that wrapped inside a <section> tag. html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Split Effect</title> </head> <body> <section> <div class="geeks"></div> </section> </body> </html> CSS Code: The CSS property is used to set the style to the image. CSS body { margin: 0; padding: 0; } section { background: url(geeks.png); position: relative; width: 100%; height: 100vh; background-size: cover; } .geeks { position: absolute; width: 100%; height: 100%; } jQuery Code: We have used the mousemove() function to track the mouse movement and apply the effect according to cursor movement. For creating a circle, just use radial-gradient along with the X and Y points that are basically the location of the cursor and provide a radius of 30% for roundness. Don't forget to apply this CSS to the div tag. javascript $(document).mousemove(function (e) { let X = e.pageX; let Y = e.pageY; $(".geeks").css("background", "radial-gradient(circle at " + X + "px " + Y + "px, transparent, #000 30%)" ); }); Complete Code: In his section, we will combine the above three sections of code (HTML, CSS, and jQuery) to create a follow-spot effect. html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Split Effect</title> <script src= "https://code.jquery.com/jquery-3.4.1.js"> </script> <style> body { margin: 0; padding: 0; } section { background: url( "https://media.geeksforgeeks.org/wp-content/cdn-uploads/Geek_logi_-low_res.png"); position: relative; width: 100%; height: 100vh; background-size: cover; } .geeks { position: absolute; width: 100%; height: 100%; } </style> </head> <body> <section> <div class="geeks"></div> </section> <script> $(document).mousemove(function (e) { let X = e.pageX; let Y = e.pageY; $(".geeks").css( "background", "radial-gradient(circle at " + X + "px " + Y + "px, transparent, #000 30%)" ); }); </script> </body> </html> Output:Â Comment More infoAdvertise with us Next Article How to create followspot effect using HTML CSS and jQuery ? S sirohimukul1999 Follow Improve Article Tags : Web Technologies JQuery jQuery-Questions Similar Reads How to create Glowing Star effect using HTML and CSS? The glowing star effect is one of the coolest effects that is used for dark themed websites. It is known as star effect because it has small glowing balls animated in different ways which looks like stars. This effect can be used for image slider, loader, and maybe as an showcase UI element.Approach 3 min read How to Create Floating Box Effect using HTML and CSS ? The floating box effect is a classical example of a custom box-shadow technique. In this technique, we create realistic-looking shadows without using the box-shadow property that is provided by the CSS. Approach: The approach is to use after selector to use create shadow using the blur function. HTM 2 min read How to Create Shock Wave or Explosion Effect using HTML and CSS? The shock wave effect is also known as the explosion effect. It is one of the simple CSS effects. For a beginner, it is one of the best examples to learn the concept of pseudo-elements. The pseudo-element that we are using is hover. First, try to create from own before jumping into the code to under 3 min read How to create a marquee effect using CSS ? In this article, we will be creating the marquee effect by using HTML and CSS. This effect can be created by using the <marquee> tag in HTML, but we will not use this tag as it is not widely used nowadays. We will create and design a marquee effect by using the CSS classes and styling properti 2 min read How to create text-reveal effect using HTML and CSS ? Text-reveal is a type of effect in which all the alphabets of the text are revealed one by one in some animated way. There are uncountable ways to animate text for this effect. It is up to your creativity how you want the text to reveal. We will look at a basic and easy way to get started. Table of 3 min read How to create paper corner fold effect on hover by using HTML and CSS? The folding effect is quite attractive on the website, may you have seen on some websites when you hover on the paging layout it gets folded on the corner. The folding corner effect can be achieved by using HTML and CSS only. The below sections will guide you on how to create the animation. In this 3 min read How to create a Spotlight Effect using HTML and CSS ? In this article, we are going to create a spotlight effect over the image when we hover over it. This is mainly based on HTML, CSS and JavaScript. The below steps have to be followed to create this effect.HTML Section: In this section, we will create a container elements for the background image and 4 min read How to Create Text Reveal Effect for Buttons using HTML and CSS ? Buttons are the most important user interface component for any website. It is very important to design the buttons in a creatively unique way. The text-reveal effect for a button is used when it is used to reveal some offer or exciting content for enhancing the user experience. Approach: The approa 2 min read How to create an Image Overlay Zoom Effect on hover using CSS ? Image Overlay Zoom Effect on hover can be done by using CSS. This effect is used in web design for user attention to images by highlighting the content or text, and to improve the overall look of a website by adding dynamic visual effects. We have given a Zoom effect to the text and image when the u 2 min read How to Create an Image Overlay Fade in Text Effect on Hover using CSS ? In the context of web design, it's all about making dynamic and interesting user experiences(UI). Adding picture overlay effects to the website is a good method to improve the aesthetic appeal, especially when users interact with it by hovering over images. This article will walk you through the ste 3 min read Like