Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Look mum, I'm typing!
css
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400"); .text-js { opacity: 0; } .cursor { display: block; position: absolute; height: 100%; top: 0; right: -5px; width: 2px; /* Change colour of Cursor Here */ background-color: white; z-index: 1; -webkit-animation: flash 0.5s none infinite alternate; animation: flash 0.5s none infinite alternate; } @-webkit-keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } } @keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } } * { margin: 0; padding: 0; boz-sizing: border-box; font-family: "Open Sans", sans-serif; } body { background: linear-gradient(135deg, #00C4FF, #9D1BB2); height: 100vh; display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -webkit-box-pack: center; justify-content: center; } .headline { margin: 20px; color: white; font-size: 32px; text-align: center; } .headline h1 { letter-spacing: 1.6px; font-weight: 300; } .twitterLink { position: absolute; bottom: 0; right: 0; margin: 10px 15px; z-index: 3; } .twitterLink svg { width: 25px; } .credit { position: fixed; bottom: 20px; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); color: white; text-decoration: none; }
JavaScript
// DISCLAIMER: This function does require jQuery. I've used it here because the project I'm building this for already uses jQuery, so I thought why not. It can be modified quite simply to be done in raw JavaScript. Just thought I'd let you know. // This is the funtion you need to copy // Copy from line 9 to 34 function autoType(elementClass, typingSpeed){ var thhis = $(elementClass); thhis.css({ "position": "relative", "display": "inline-block" }); thhis.prepend('
'); thhis = thhis.find(".text-js"); var text = thhis.text().trim().split(''); var amntOfChars = text.length; var newString = ""; thhis.text("|"); setTimeout(function(){ thhis.css("opacity",1); thhis.prev().removeAttr("style"); thhis.text(""); for(var i = 0; i < amntOfChars; i++){ (function(i,char){ setTimeout(function() { newString += char; thhis.text(newString); },i*typingSpeed); })(i+1,text[i]); } },1500); } $(document).ready(function(){ // Now to start autoTyping just call the autoType function with the // class of outer div // The second paramter is the speed between each letter is typed. autoType(".type-js",200); });
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>自动输入文本(功能)-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号