Simple Animated Text Using HTML/jQuery
Submitted by razormist on Monday, August 14, 2017 - 19:13.
In this tutorial we will create a Simple Animated Text Using jQuery. The jQuery is a fast, reliable kind of cross-platform javascript library. It is designed to simplify the traditional way of coding in javascript. So let's now do the coding.
Creating the Mark Up
To display the animated text will need to create the mark up language, to do that open any kind of text editor(notepad++, etc). Then copy/paste the provided code below and name it 'index.html'
The script below trigger the text to animated when either of the two button is clicked.
Adding CSS
To add a style to our animated text, just simply copy/paste the code below. Then save it as 'style.css', and put it into the css folder.
There you have it we created a Simple Animated Text Using jQuery. I hope that this tutorial help you for what you are looking for. For more updates and tutorial just kindly visit this site. Enjoy Coding!!
- <!DOCTYPE html>
- <html lang = "en">
- <head>
- <meta charset = "utf-8" name = "viewport" content = "width=device-width, initial-scale=1" />
- <link rel = "stylesheet" type = "text/css" href = "css/style.css" />
- <link rel = "stylesheet" type = "text/css" href = "css/bootstrap.css" />
- </head>
- <body>
- <nav class = "navbar navbar-default">
- <div class = "container-fluid">
- </div>
- </nav>
- <div class = "col-md-6 well">
- <hr style = "border-top:1px dotted #000;"/>
- <center>
- <ul class = "text-animation text-primary">
- </ul>
- </center>
- </div>
- </body>
- <script type = "text/javascript">
- $(document).ready(function(){
- $('.animate').on('click', function(){
- setTimeout(function(){
- $('.text-animation').removeClass('rumble');
- }, 500);
- });
- $('.rum').on('click', function(){
- setTimeout(function(){
- $('.text-animation').addClass('rumble');
- }, 500);
- });
- });
- </script>
- </html>
- .text-animation{
- list-style:none;
- }
- .text-animation li{
- display:inline-block;
- opacity:1;
- font-size:30px;
- transition:all 3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
- }
- .text-animation li:last-child{
- margin-right:0;
- }
- .text-animation.rumble{
- opacity:1;
- }
- .text-animation.rumble li:nth-child(1){transform: translateX(-200px) translateY(-200px);}
- .text-animation.rumble li:nth-child(2){transform: translateX(20px) translateY(100px);}
- .text-animation.rumble li:nth-child(3){transform: translateX(-150px) translateY(-80px);}
- .text-animation.rumble li:nth-child(4){transform: translateX(10px) translateY(-120px);}
- .text-animation.rumble li:nth-child(5){transform: translateX(-200px) translateY(15px);}
- .text-animation.rumble li:nth-child(6){transform: translateX(-300px) translateY(-20px);}
- .text-animation.rumble li:nth-child(7){transform: translateX(20px) translateY(40px);}
- .text-animation.rumble li:nth-child(8){transform: translateX(30px) translateY(-200px);}
- .text-animation.rumble li:nth-child(9){transform: translateX(20px) translateY(100px);}
- .text-animation.rumble li:nth-child(10){transform: translateX(-150px) translateY(-80px);}
- .text-animation.rumble li:nth-child(11){transform: translateX(10px) translateY(-140px);}
- .text-animation.rumble li:nth-child(12){transform: translateX(230px) translateY(90px);}
- .text-animation.rumble li:nth-child(13){transform: translateX(10px) translateY(-150px);}
- .text-animation.rumble li:nth-child(14){transform: translateX(210px) translateY(110px);}
Add new comment
- 140 views