Typing & erasing effects, plus a blinking cursor
How do I make an typing & erasing effects, plus a blinking cursor?
Demo of typing & erasing effects, plus a blinking cursor (full-text tutorial).. What is a typing & erasing effects, plus a blinking cursor? How do you make a typing & erasing effects, plus a blinking cursor? This script and codes were developed by Stathis on 31 July 2022, Sunday.
Typing & erasing effects, plus a blinking cursor - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Typing & erasing effects, plus a blinking cursor</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <p> <input type="text" id="user-caption" value="Type something here!" /> <input type="button" id="test-typing" value="Test Typing Effect" /> <input type="button" id="test-erasing" value="Test Erasing Effect" />
</p>
<p class="console"> <span>C:\</span><span id="caption"></span><span id="cursor">|</span>
</p> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Typing & erasing effects, plus a blinking cursor - Script Codes CSS Codes
body
{ background-color: #000; padding: 1%; color: #ccc; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1em;
}
.console
{ font-family: "Lucida Sans Typewriter", "Lucida Console", Monaco, "Bitstream Vera Sans Mono", monospace;
}
input[type="button"]
{ cursor: pointer;
}
Typing & erasing effects, plus a blinking cursor - Script Codes JS Codes
var captionLength = 0;
var caption = '';
$(document).ready(function() { setInterval ('cursorAnimation()', 600); captionEl = $('#caption'); $('#test-typing').click(function(){ testTypingEffect(); }); $('#test-erasing').click(function(){ testErasingEffect(); });
});
function testTypingEffect() { caption = $('input#user-caption').val(); type();
}
function type() { captionEl.html(caption.substr(0, captionLength++)); if(captionLength < caption.length+1) { setTimeout('type()', 50); } else { captionLength = 0; caption = ''; }
}
function testErasingEffect() { caption = captionEl.html(); captionLength = caption.length; if (captionLength>0) { erase(); } else { $('#caption').html("You didn't write anything to erase, but that's ok!"); setTimeout('testErasingEffect()', 1000); }
}
function erase() { captionEl.html(caption.substr(0, captionLength--)); if(captionLength >= 0) { setTimeout('erase()', 50); } else { captionLength = 0; caption = ''; }
}
function cursorAnimation() { $('#cursor').animate({ opacity: 0 }, 'fast', 'swing').animate({ opacity: 1 }, 'fast', 'swing');
}
Developer | Stathis |
Username | stathisg |
Uploaded | July 31, 2022 |
Rating | 4.5 |
Size | 2,362 Kb |
Views | 54,648 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Large vertical menu with CSS3 transitions | 3,352 Kb |
A slideshow with a blinds transition | 2,923 Kb |
Mosaic transition effect between two photos using jQuery | 2,518 Kb |
Large horizontal menu with CSS3 transitions | 3,403 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Slides-07-1 POSITION | Exhtml | 1,909 Kb |
Add This API | ThatGuySam | 2,848 Kb |
Simple Flat Menu | Jeplaa | 2,467 Kb |
UI Challenge - Budget Selector | AgentRR007 | 3,547 Kb |
A simple log in form made with css | Mayurelbhar | 2,160 Kb |
Blog demo to use given styling | Andygirl | 2,412 Kb |
RRC wrapSwitch | Pshrmn | 2,922 Kb |
Playing with transition timing | Mattgrosswork | 1,993 Kb |
SVG email test v2.0 | M_J_Robbins | 2,090 Kb |
Update CSS Variables with JS | Wesbos | 2,335 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!