input textbox 제목을 textbox 안에 간단히 표시해보자
적용소스
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Placeholdem // Placeholder Caret Animation</title> <link href="assets/css/style.min.css" rel="stylesheet"> <link href="assets/images/favicon.ico" rel="shortcut icon" type="image/x-icon"> </head> <body> <div class="container"> <h3 class="fade">placeholder</h3> <form> <label class="fade"> <input name="field1" placeholder="제목을 입력하세요." /> <div class="arrow"></div> </label> <label class="fade"> <textarea name="field2" placeholder="내용을 입력하세요."></textarea> <div class="arrow"></div> </label> </form> <script src="placeholdem.min.js"></script> <script> Placeholdem( document.querySelectorAll( '[placeholder]' ) ); var fadeElems = document.body.querySelectorAll( '.fade' ), fadeElemsLength = fadeElems.length, i = 0, interval = 50; function incFade() { if( i < fadeElemsLength ) { fadeElems[ i ].className += ' fade-load'; i++; setTimeout( incFade, interval ); } } setTimeout( incFade, interval ); </script> </body> </html> |
git hub : https://github.com/jackrugile/placeholdem