ããã¹ãããã¯ã¹ã®æ®ãå ¥åæåæ°ãã·ã³ãã«ã«è¡¨ç¤ºããjQueryãã©ã°ã¤ã³ m5simpleTextCount
ããã¹ãå ¥åã¨ãªã¢ãªã©ã®æ®ãå ¥åæåæ°ãã·ã³ãã«ã«è¡¨ç¤ºããjQueryãã©ã°ã¤ã³ã§ãã使ãæ¹ãç°¡åã§ãæå®è¦ç´ ã«å ¥åæåæ°ã¨ä¸ç·ã«å®è¡ããã ãã§ãã
å¿ è¦ãªãã¡ã¤ã«ãèªã¿è¾¼ã
jQueryã¨m5simpleTextCount.jsãèªã¿è¾¼ã¿ã¾ãã
ä»»æã®è¦ç´ ã«å¯¾ãã¦å®è¡ãã
ä»»æã®input, textareaã«å¯¾ãã¦å®è¡ãã¾ãã
HTML
JS
jQuery(function($) { Â Â $('.simpleTextCount').simpleTextCount({ Â Â Â Â maxLength: 12 Â Â }); });
ã¡ãªã¿ã«m5simpleTextCountãå®è¡ããinputè¦ç´ ã¯paddingRightãtextareaè¦ç´ ã¯paddingRight, paddingBottomã«é©å½ãªæ°å¤ãå½ã¦ãã»ããããã¨æãã¾ããï¼(ããã¯æåãããã§ã»ã»ã»
ãªãã·ã§ã³
ãªãã·ã§ã³ãæå®ããããã©ã«ãã®æåã»èæ¯è²ãæ®ãæåæ°ãå°ãªããªã£ãã¨ãã®æåã»èæ¯è²ãªã©ãä»»æã«æå®ã§ãã¾ããå ¨ã¦æ®ãæåæ°ã表示ããè¦ç´ ã対象ã§ãã
$('.simpleTextCount').simpleTextCount({ Â Â atColor: '#fff', Â Â atBackground: '#000', Â Â alertLength: 5, Â Â maxLength: 12 });
name | value |
---|---|
focusDisplay | trueãæå®ããã¨ãã©ã¼ã«ã¹ããã¨ãã ãæ®ãæåæ°ã表示ãã (def â false |
padding | padding (def â â3pxâ |
color | æåè² (def â â#000â² |
background | èæ¯è² (def â â#eeeâ |
fontWeight | æåã®å¤ªã (def â ânormalâ |
atColor | å°ãªããªã£ãã¨ãã®æåè² (def â â#f00â² |
atBackground | å°ãªããªã£ãã¨ãã®èæ¯è² (def â â#eeeâ |
atFontWeight | å°ãªããªã£ãã¨ãã®æåã®å¤ªã (def â âboldâ |
opacity | éé度 (def â .8 |
alertLength | ã¹ã¿ã¤ã«ãå¤ããæåæ° (def â 0 |
maxLength | æ®ãå ¥åæåæ° (def â 10 |
ã²ã¨ããã¨
exValidationã®æåæ°å¶éããªãã¼ã·ã§ã³ã¨ä½µç¨ãããã¦ä½ã£ãã®ã§ãä½µç¨ããã¨ããæ°ããã¾ããæ©è½ãã¢ã¸ã¥ã¼ã«ã«ããã»ããããæ°ããã¦ãã
Leave a comment
Trackbacks: 0
- Trackback URL for this entry
- Listed below are links to weblogs that reference
- ããã¹ãããã¯ã¹ã®æ®ãå ¥åæåæ°ãã·ã³ãã«ã«è¡¨ç¤ºããjQueryãã©ã°ã¤ã³ m5simpleTextCount from 5509
Comments: 4 - Leave a comment
æçãªjsãåèã«ããã¦ããã ãã¦ããã¾ãã
ãã¡ãã§ãããjQuery v1.6.2ã§ä½¿ç¨ããã¨æ°åã表示ããã«ã¦ã³ãä½ç½®ãªã©ããºã¬ã¦ãã¾ããã(æ©è½ã¯ãã¦ãã模æ§)
æç´ããå¿ è¦ãªç®æãæ¢ãã¦ããã®ã§ããããªããªãè©°ã¾ã£ã¦ããã¾ãã(ffãIEææ°çã§ç¢ºèªãã¦ãã¾ã)
ãå©è¨ããã ããã°å¹¸ãã§ãã
å½æ¹ãåãåé¡ãçºçããããã調ã¹ãã¨ãã offsetWidthå¨ãã®åé¡ã®ããã§ããã
æ¢ã«è§£èª¬è¨äºãããã¾ããã https://5509.me/log/jquery16s-attr ãåèã«ã attr(âoffsetWidth(Height)â) ãåç §ãã¦ããé¨å(2ã«æï¼ãæ¸ãæããã¨æ£ããåä½ãããã¨ã確èªãã¾ããã
使ããã¦ããã ãã¾ãã
æ©è½ãã¢ã¸ã¥ã¼ã«åãã¦åå¥ã§ä½¿ããããã«ããã®ã¯è¯ãèãããã
exValidationã®ãã®æ©è½ã ã使ããããã ãï¼
ã£ã¦ããéè¦ããããã¯åãããªããã©ã
ã¨ããããselectableã¯ãã¸ã§æé«ã§ããã
cooooooooooool!!!!
exValidationã¯ãã以ä¸åããªããããªæ°ããããã©ãä¾ãã°selectableãã¢ã¸ã¥ã¼ã«ã«ããã¨ãï¼
selectableã¯æé«ã§ãããï¼ããã¾ãèªåã§ä½¿ãæ©ä¼ãªããã©ï¼