Shining Effect on Text with CSS3 and jQuery – shineText

Shining Effect on Text with CSS3 and jQuery
Code Snippet:shineText
Author: Kostas Minaidis
Published: January 12, 2024
Last Updated: January 22, 2024
Downloads: 3,367
License: MIT
Edit Code online: View on CodePen
Read More

A lightweight jQuery plugin to create a shining effect on text with CSS3. The plugin offers to shine any text on different JavaScript events (i.e click, hover, touch, etc.) with custom speed timing. You can also set up a custom CSS style class for shining text.

How to Create Text Shining Effect

1. To get started with shineText, load the jQuery and plugin assets into HTML document.

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.4.0.min.js"></script>

<!-- Shine Text CSS -->
<link rel="stylesheet" href="css/jquery.shining.min.css">

<!-- Shine Text Js -->
<script src="js/jquery.shining.js"></script>

2. After that, set a unique id to text that you want to shine.

<h1 id="myText"> CSS 3 SHINING TEXT </h1>

3. Finally initialize the plugin (with click, mouseenter, mouseleave or your desired event).

$("#text").click(function() { 

   $(this).shineText();

});

Advance Configuration Options for Shining Effect on Text

The following are some advanced configuration options to create/customize “Shining Effect on Text”.

speed This option defines the shine effect moving speed. Default: 50, Type: number

$(this).shineText({
   speed: 200,
});
shineClass Define the CSS style class for the shining text. You can set your own CSS style with the custom class through this option. Default: “shine”, Type: String

$(this).shineText({
   shineClass: "custom-class",
});
complete The callback function that will be executed after the completion of shineText. Default: null, Type: function

$(this).shineText({
   complete: function(){
   
      //do something
   }
});

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About CodeHim

Free Web Design Code & Scripts - CodeHim is one of the BEST developer websites that provide web designers and developers with a simple way to preview and download a variety of free code & scripts. All codes published on CodeHim are open source, distributed under OSD-compliant license which grants all the rights to use, study, change and share the software in modified and unmodified form. Before publishing, we test and review each code snippet to avoid errors, but we cannot warrant the full correctness of all content. All trademarks, trade names, logos, and icons are the property of their respective owners... find out more...

Please Rel0ad/PressF5 this page if you can't click the download/preview link

X