jquery.jaticker.js2011-12-08
â«Download
jquery.jaticker.js ã¯æ¥æ¬èªã®å¤æã¢ãã¡ã¼ã·ã§ã³ã«å¯¾å¿ããããã£ãã«ã¼ã® jQuery ãã©ã°ã¤ã³ã§ããæååãã¿ã¤ããã¦ãã風ã«é ã«è¡¨ç¤ºããäºãåºæ¥ã¾ãã
使ãæ¹
ä¸é¨ã® Download ãªã³ã¯ãã zip ãã¡ã¤ã«ããã¦ã³ãã¼ããã¦è§£åããã¨ãcss ãã¡ã¤ã«ã¨ js ãã¡ã¤ã«ã 1 ã¤ãã¤å«ã¾ãã¦ããã®ã§ãããèªã¿è¾¼ã¿ã¾ããjQuery ãã©ã°ã¤ã³ã§ãã®ã§ãjQuery èªä½ã¯å ã«èªã¿è¾¼ãã§ããã¦ä¸ããã
<head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> <script type="text/javascript" src="jquery.jaticker_1.0.0.js"></script> <link rel="stylesheet" href="jquery.jaticker_1.0.0.css" type="text/css"> </head>
jQuery ãªãã¸ã§ã¯ãã«ãã©ã°ã¤ã³ã® jaticker ã¡ã½ããã追å ãããã®ã§ã対象ã¨ãªãè¦ç´ ã«å¯¾ãã¦å¼ã³åºãã¨ããã®è¦ç´ ã«å«ã¾ããããã¹ããã¿ã¤ããã¦ãã風ã«ã¢ãã¡ã¼ã·ã§ã³ãã¦è¡¨ç¤ºãã¾ãã
ãã®æç¹ã§ãè±æ°åãã²ãããªãã«ã¿ã«ãã¯ãããªãã«ã¡ããã¨è¡¨ç¤ºããã¾ãããæ¼¢åã«ã¤ãã¦ã¯èªã¿ã®æ å ±ããªãããå¤æã®ã¢ãã¡ã¼ã·ã§ã³ã¯ãã¾ããã
ããã§ååã¨ããå ´åã¯ãã®ã¾ã¾ä½¿ã£ã¦ãæ§ãã¾ããã
<div id="jaticker-1"> ã²ãããªãã«ã¿ã«ãã ããªãããã ã㧠OK !<br /> æ¼¢åãæ··ããã¨ã¡ãã£ã¨æ®å¿µãªæãã </div> <script> $('#jaticker-1').jaticker(); </script>
ã²ãããªãã«ã¿ã«ãã ããªãããã ã㧠OK ! æ¼¢åãæ··ããã¨ã¡ãã£ã¨æ®å¿µãªæãã
æ¼¢åã«å¯¾ãã¦èªã¿ãæå®ããã¨ãã¯ãruby è¦ç´ ã使ãã¾ããruby è¦ç´ ã«å²ã¾ããä¸ã« rt è¦ç´ ãããã¨ããããèªã¿ã¨ãã¦ä½¿ã£ã¦æ¥æ¬èªå¤æã®ã¢ãã¡ã¼ã·ã§ã³ãè¡ãã¾ãã
å¤æãè¡ãã¢ãã¡ã¼ã·ã§ã³ã¯ ruby è¦ç´ ã®åä½ã«ãªãã®ã§ãæ¼¢åã ãã«ã«ããæ¯ãã®ã§ã¯ãªããéãä»®åãªã©ã¾ã§å«ããã«ããæ¯ãã¨ããããããªãã¾ãã
<ruby>æ¼¢åã®èªã¿ã¯<rt>ãããã®ãã¿ã¯</rt></ruby><ruby> ruby è¦ç´ ã§<rt> ruby ãããã§</rt></ruby><ruby>æå®ãã¦ä¸ããã<rt>ãã¦ããã¦ãã ããã</rt></ruby>
æ¼¢åã®èªã¿ã¯ ruby è¦ç´ ã§æå®ãã¦ä¸ããã
ã¤ã³ã©ã¤ã³è¦ç´ ã«ããæ¸å¼æå®ãªã©ã¯ããã®ã¾ã¾ã«åæ ããã¾ãã
<span style="color:red"><ruby>æåã®è²ã<rt>ããã®ããã</rt></ruby><ruby>å¤ãããã<rt>ããããã</rt></ruby></span><span style="font-size:200%;"><ruby>æåã®å¤§ããã<rt>ããã®ããããã</rt></ruby><ruby>å¤ããããã¦ãã<rt>ãããããã¦ãã</rt></ruby></span><ruby>大ä¸å¤«ã<rt>ã ããããã¶ã</rt></ruby>
æåã®è²ãå¤ããããæåã®å¤§ãããå¤ããããã¦ãã大ä¸å¤«ã
ã¢ãã¡ã¼ã·ã§ã³ã®é度ãè½ã¨ãã¨ããåããã¾ãããã¿ã¤ããã¦ããå 容ã¯ã¡ããã¨ãã¼ãåã«å解ãã¦ã¢ãã¡ã¼ã·ã§ã³ãã¦ãã¾ãã
ã¡ããã¨ãã¼ãåå ¥åãã¦ãã¾ãã
ã¢ãã¡ã¼ã·ã§ã³ä¸ã®ãã©ã³ãã®æ¸å¼ã«ã¤ãã¦ã¯ãããã©ã«ãã® css ãä¿®æ£ãããã追å ã® css ãæå®ãããã¨ã§å¤æ´ã§ãã¾ãã
/* ã«ã¼ã½ã« */ .jaticker-cursor { font-weight: bold; color: red; } /* å ¥åä¸ */ .jaticker-input { color: green; background-color: white; } /* å¤æä¸ */ .jaticker-convert { color: blue; background-color: white; }
ã¢ãã¡ã¼ã·ã§ã³ã®æ¸å¼ãå¤æ´ã§ãã¾ãã
ãªãã·ã§ã³
jaticker ã®å®è¡æã«å¼æ°ã§ãªãã·ã§ã³ãæå®ããäºã§ãåä½ãè²ã ã¨å¤æ´ããäºãåºæ¥ã¾ãããªãã·ã§ã³ã®ååã¨ããã©ã«ãå¤ã¯ä»¥ä¸ã®éãã§ãã
åå | æå³ | ããã©ã«ãå¤ |
---|---|---|
inputSpeed | ãã¼ã¿ã¤ãã¢ãã¡ã¼ã·ã§ã³ã®é度 (msec) | 60 |
convertSpeed | å¤æã¢ãã¡ã¼ã·ã§ã³ã®é度 (msec) | 120 |
autoStart | ã¢ãã¡ã¼ã·ã§ã³ãèªåçã«éå§ããã | true |
cursorStr | ã«ã¼ã½ã«ã®æåå | '|' |
cursorInterval | ã«ã¼ã½ã«ã®ç¹æ» é度 (msec) | 500 |
hideCursor | ã«ã¼ã½ã«ãé ãã | false |
leaveCursor | ã¢ãã¡ã¼ã·ã§ã³å®äºå¾ã«ã«ã¼ã½ã«ãæ¶ãã | false |
onFinished | ã¢ãã¡ã¼ã·ã§ã³å®äºæã«å¼ã°ããã³ã¼ã«ããã¯é¢æ° | undefined |
autoStart ã false ã¨ãã¦åæåããå ´åãã¢ãã¡ã¼ã·ã§ã³ãèªåçã«ã¯å§ã¾ãã¾ãããã¢ãã¡ã¼ã·ã§ã³ãéå§ããããã«ã¯ãjaticker ãå®è¡ããè¦ç´ ã«å¯¾ãã¦ãjatickerStart ãå®è¡ãã¾ãã
// åæåã®ã¿ $('#jaticker').jaticker({'autoStart': false}); // ã¢ãã¡ã¼ã·ã§ã³éå§ $('#jaticker').jatickerStart();
onFinished ã«é¢æ°ãæå®ããã¨ãã¢ãã¡ã¼ã·ã§ã³ãå®äºããæã«å®è¡ããã¾ãã
ä¾ãã°ããã使ã£ã¦ãè¤æ°ã®ã¢ãã¡ã¼ã·ã§ã³ãé£æºãããäºãªã©ãåºæ¥ã¾ãã
$('#jaticker-2').jaticker({'autoStart': false}); $('#jaticker-1').jaticker({'onFinished': function() { $('#jaticker-2').jatickerStart(); }});
å®è¡ç°å¢ã»ã©ã¤ã»ã³ã¹
jQuery 1.4 以éã®ç°å¢ã§åä½ãã¾ããåä½ç¢ºèªãè¡ã£ããã©ã¦ã¶ã¯ãFirefox3.6 / Google Chrome 15 / IE6 / IE7 ã§ããæãããå¤ã Chrome / Firefox4+ / æè¿ã®Safari / æè¿ã® Opera 辺ãã¯åãã¾ããæªç¢ºèªã§ãã IE8 / IE9 ããã¶ãåãã§ãããã
ãããã«ã¤ãã¦ããåä½å ±åãããã°æãé£ãã§ãã
ã©ã¤ã»ã³ã¹ã¯ MIT License (æ¥æ¬ç wikipedia ã®é ) ã§å ¬éãã¦ãã¾ãã