dz¼±µµ¿ò¸»...

¤ýÈ£°¡°èºÎ¸¦ ½ÃÀÛÆäÀÌÁö·Î

ÀºÇà Ä«µå Áõ±Ç º¸Çè ºÎµ¿»ê

     
My Áñ°Üã±â ¼öÁ¤
[¹«·á]  ¿À´ÃÀÇ ¿î¼¼  /  ¹ÙÀÌ¿À¸®µë
¿©±â´Â ȸ¿ø´ÔÀÌ Á÷Á¢ µî·ÏÇϽÅ
Áñ°Üã´Â »çÀÌÆ®°¡ Ãâ·ÂµË´Ï´Ù.
ÄÄÇ»ÅÍ¿Í °ü·ÃÀÖ´Â ¸ðµç ÆÁÀ» °øÀ¯ÇսôÙ.

javascript·Î HTML5 ¿¡¼­ Àç°øÇÏ´Â Placeholder ±â´ÉÀ» ±¸ÇöÇÑ´Ù.

È£°¡°èºÎ|2014-07-03 08:35:41|Á¶È¸ : 58804
javascript·Î HTML5 ¿¡¼­ Àç°øÇÏ´Â Placeholder ±â´ÉÀ» ±¸ÇöÇÑ´Ù.


Placeholders.js´Â input°ú textarea µÑ´Ù ÀÛµ¿ÇÑ´Ù.

jQuery ¾øÀÌ »ç¿ëÇÑ´Ù.

HTML ÆäÀÌÁö ¸¶Áö¸·¿¡ Placeholders.js ¸¦ Load ÇÑ´Ù.


<script type="text/javascript">
(function(t){"use strict";function e(t,e,r){return t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent?t.attachEvent("on"+e,r):void 0}function r(t,e){var r,n;for(r=0,n=t.length;n>r;r++)if(t[r]===e)return!0;return!1}function n(t,e){var r;t.createTextRange?(r=t.createTextRange(),r.move("character",e),r.select()):t.selectionStart&&(t.focus(),t.setSelectionRange(e,e))}function a(t,e){try{return t.type=e,!0}catch(r){return!1}}t.Placeholders={Utils:{addEventListener:e,inArray:r,moveCaret:n,changeType:a}}})(this),function(t){"use strict";function e(){}function r(){try{return document.activeElement}catch(t){}}function n(t,e){var r,n,a=!!e&&t.value!==e,u=t.value===t.getAttribute(V);return(a||u)&&"true"===t.getAttribute(D)?(t.removeAttribute(D),t.value=t.value.replace(t.getAttribute(V),""),t.className=t.className.replace(R,""),n=t.getAttribute(F),parseInt(n,10)>=0&&(t.setAttribute("maxLength",n),t.removeAttribute(F)),r=t.getAttribute(P),r&&(t.type=r),!0):!1}function a(t){var e,r,n=t.getAttribute(V);return""===t.value&&n?(t.setAttribute(D,"true"),t.value=n,t.className+=" "+I,r=t.getAttribute(F),r||(t.setAttribute(F,t.maxLength),t.removeAttribute("maxLength")),e=t.getAttribute(P),e?t.type="text":"password"===t.type&&M.changeType(t,"text")&&t.setAttribute(P,"password"),!0):!1}function u(t,e){var r,n,a,u,i,l,o;if(t&&t.getAttribute(V))e(t);else for(a=t?t.getElementsByTagName("input"):b,u=t?t.getElementsByTagName("textarea"):f,r=a?a.length:0,n=u?u.length:0,o=0,l=r+n;l>o;o++)i=r>o?a[o]:u[o-r],e(i)}function i(t){u(t,n)}function l(t){u(t,a)}function o(t){return function(){m&&t.value===t.getAttribute(V)&&"true"===t.getAttribute(D)?M.moveCaret(t,0):n(t)}}function c(t){return function(){a(t)}}function s(t){return function(e){return A=t.value,"true"===t.getAttribute(D)&&A===t.getAttribute(V)&&M.inArray(C,e.keyCode)?(e.preventDefault&&e.preventDefault(),!1):void 0}}function d(t){return function(){n(t,A),""===t.value&&(t.blur(),M.moveCaret(t,0))}}function g(t){return function(){t===r()&&t.value===t.getAttribute(V)&&"true"===t.getAttribute(D)&&M.moveCaret(t,0)}}function v(t){return function(){i(t)}}function p(t){t.form&&(T=t.form,"string"==typeof T&&(T=document.getElementById(T)),T.getAttribute(U)||(M.addEventListener(T,"submit",v(T)),T.setAttribute(U,"true"))),M.addEventListener(t,"focus",o(t)),M.addEventListener(t,"blur",c(t)),m&&(M.addEventListener(t,"keydown",s(t)),M.addEventListener(t,"keyup",d(t)),M.addEventListener(t,"click",g(t))),t.setAttribute(j,"true"),t.setAttribute(V,x),(m||t!==r())&&a(t)}var b,f,m,h,A,y,E,x,L,T,N,S,w,B=["text","search","url","tel","email","password","number","textarea"],C=[27,33,34,35,36,37,38,39,40,8,46],k="#777777",I="placeholdersjs",R=RegExp("(?:^|\s)"+I+"(?!\S)"),V="data-placeholder-value",D="data-placeholder-active",P="data-placeholder-type",U="data-placeholder-submit",j="data-placeholder-bound",q="data-placeholder-focus",z="data-placeholder-live",F="data-placeholder-maxlength",G=document.createElement("input"),H=document.getElementsByTagName("head")[0],J=document.documentElement,K=t.Placeholders,M=K.Utils;if(K.nativeSupport=void 0!==G.placeholder,!K.nativeSupport){for(b=document.getElementsByTagName("input"),f=document.getElementsByTagName("textarea"),m="false"===J.getAttribute(q),h="false"!==J.getAttribute(z),y=document.createElement("style"),y.type="text/css",E=document.createTextNode("."+I+" { color:"+k+"; }"),y.styleSheet?y.styleSheet.cssText=E.nodeValue:y.appendChild(E),H.insertBefore(y,H.firstChild),w=0,S=b.length+f.length;S>w;w++)N=b.length>w?b[w]:f[w-b.length],x=N.attributes.placeholder,x&&(x=x.nodeValue,x&&M.inArray(B,N.type)&&p(N));L=setInterval(function(){for(w=0,S=b.length+f.length;S>w;w++)N=b.length>w?b[w]:f[w-b.length],x=N.attributes.placeholder,x?(x=x.nodeValue,x&&M.inArray(B,N.type)&&(N.getAttribute(j)||p(N),(x!==N.getAttribute(V)||"password"===N.type&&!N.getAttribute(P))&&("password"===N.type&&!N.getAttribute(P)&&M.changeType(N,"text")&&N.setAttribute(P,"password"),N.value===N.getAttribute(V)&&(N.value=x),N.setAttribute(V,x)))):N.getAttribute(D)&&(n(N),N.removeAttribute(V));h||clearInterval(L)},100)}M.addEventListener(t,"beforeunload",function(){K.disable()}),K.disable=K.nativeSupport?e:i,K.enable=K.nativeSupport?e:l}(this);
</script>





¹øÈ£ Á¦             ¸ñ ÷ºÎ ÀÛ ¼º ÀÏ ÀÛ¼ºÀÚ Á¶È¸
105  

[¿¢¼¿] ƯÁ¤ ÀÚ¸´¼ö ¼ýÀÚ ¹Ý¿Ã¸²

  2019-08-22 È£°¡°èºÎ 1488
104  

[Android] Chrome Custom Tabs ½ÃÀÛÇϱâ

(2)
  2019-08-17 È£°¡°èºÎ 35108
103  

[Android] »óŹ٠¾ø¾Ö±â

2019-08-13 È£°¡°èºÎ 1752
102  

[Android] ŸÀÌƲ¹Ù ¾ø¾Ö±â

2019-08-13 È£°¡°èºÎ 2542
101  

[Android] ERR_CLEARTEXT_NOT_PERMITTED À¥ºä È£Ãâ ¿¡·¯

  2019-08-11 È£°¡°èºÎ 2301
100  

Chrome Å©·Ò °­·Â »õ·Î°íħ ´ÜÃàÅ°

  2019-07-15 È£°¡°èºÎ 24673
99  

ȨÆäÀÌÁö(À¥ºê¶ó¿ìÀú) â °¡·Î ¼¼·Î È®ÀÎ ¹æ¹ý

  2019-07-07 È£°¡°èºÎ 24483
98  

Html CSS ¼öÁ÷À¸·Î Áß¾Ó Á¤·Ä ÇÏ´Â ¹æ¹ý

  2019-07-05 È£°¡°èºÎ 4683
97  

textarea ¿£ÅÍÅ° ÀÔ·ÂÇÒ¶§¸¶´Ù ÀԷ¹ڽº ³ôÀ̸¦ Áõ°¡½ÃÅ°´Â ÀÚ¹Ù...

(1)
  2019-06-19 È£°¡°èºÎ 4728
96  

javascript encodeURI -> php EUC-KR decode

(1)
  2019-06-18 È£°¡°èºÎ 40919
95  

À©µµ¿ì â ´ÜÃàÅ°

  2019-06-07 È£°¡°èºÎ 3260
94  

ÄÄÇ»ÅÍ Á¾·á½Ã°£ ¿¹¾àÇϱâ

2019-03-22 È£°¡°èºÎ 4641
93  

¸»Ç³¼± À§Ä¡ °è»ê (¸¶¿ì½º Æ÷ÀÎÅÍ À§Ä¡°è»ê)

  2019-01-14 È£°¡°èºÎ 6975
92  

[Javascript] ³¯Â¥ À¯È¿¼º °Ë»ç

  2018-09-13 È£°¡°èºÎ 32878
89  

MySql ±âÁ¸ Ä÷³¿¡ ÀÚµ¿Áõ°¡ ¼Ó¼º º¯°æ, Ãß°¡ ¹× ÃʱâÈ­

  2018-08-15 È£°¡°èºÎ 61224
88  

CSS ¹ÝÀÀÇü ·¹À̾ƿô ¸¸µé±â

2018-07-25 È£°¡°èºÎ 55966
87  

CSS·Î ±ÛÀÚ ÀÚ¸£±â ¹× ¸»ÁÙÀÓ Ç¥½Ã Çϱâ

  2018-07-24 È£°¡°èºÎ 40826
86  

ȨÆäÀÌÁö Æ˾÷â È­¸é °¡¿îµ¥ Ãâ·ÂÇϱâ

  2018-07-12 È£°¡°èºÎ 6955
83  

URL ÃÖ´ë±æÀÌ

  2015-06-16 È£°¡°èºÎ 11037
82  

°ø°øÀúÀÛ¹° ÀÚÀ¯ÀÌ¿ë »çÀÌÆ®

  2015-06-16 È£°¡°èºÎ 12270
óÀ½À¸·Î ¾ÕÀ¸·Î | 1 [2] 3 4 5 6 | ´ÙÀ½ ¸¶Áö¸·