jQueryã§èªåã¹ã¯ãã¼ã«ãããã©ã°ã¤ã³ãä½ã£ã¦ã¿ã
ããã°ã®ã¢ã¯ã»ã¹ãã°ãçºãã¦ããããjquery èªåã¹ã¯ãã¼ã«ãã¨ããjquery ã¹ã¯ãã¼ã« èªåãã¨ãã§ã¢ã¯ã»ã¹ãã人ããããªãã«ããã®ã§ãç°¡åãªãã©ã°ã¤ã³ãä½ã£ã¦ã¿ã¾ããã
ã³ã¼ã
https://github.com/rei-m/autoScroller
â»ã½ã¼ã¹ã³ã¼ãã¯githubããè½ã¨ãã¦ãã ããã
使ãæ¹
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>auto scroll sample</title> <style> .content { font-size:11px; width:300px; } .content:nth-child(odd){ background-color:#FFEFD5; } .content:nth-child(even){ background-color: #E0FFFF; } </style> </head> <body> <h1>ããã·ã</h1> <div id="scroll"> <div class="content"> ãã£ãã<br> <br> <br> </div> <div class="content"> ã«ãã<br> <br> <br> </div> <div class="content"> ãããã<br> <br> <br> </div> <div class="content"> ãããã<br> <br> <br> </div> <div class="content"> ããã<br> <br> <br> </div> <div class="content"> ãã£ãã<br> <br> <br> </div> <div class="content"> ãªãªãã<br> <br> <br> </div> <div class="content"> ã¯ã£ãã<br> <br> <br> </div> <div class="content"> ãã ããã<br> <br> <br> </div> <div class="content"> ãã ã£ãã<br> <br> <br> </div> </div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../src/autoScroller.js"></script> <script type="text/javascript"> $("#scroll").autoScroller({ wait:3000, target:".content", display:5 }); </script> </body> </html>
æå®å¯è½ãªãªãã·ã§ã³ã¯ä»¥ä¸ã®éãã§ãã
wait : ã¹ã¯ãã¼ã«ã®å¾
ã¡æéï¼default:3000ï¼
speed : ã¹ã¯ãã¼ã«ã®ã¢ãã¡ã¼ã·ã§ã³ã¹ãã¼ãï¼default:500ï¼
target : autoScrollerå
ã®ã¹ã¯ãã¼ã«ã³ã³ãã³ãã®ã»ã¬ã¯ã¿ï¼default:divè¦ç´ ãæ¾ãã¾ãï¼
display : ã¹ã¯ãã¼ã«ã§è¡¨ç¤ºããã³ã³ãã³ãæ°ï¼default:5ï¼
ãµã³ãã«
ãã®ä»
ä½ãä¸å
·åã»è¦æçããã°ãã¡ãã«ã©ãã¼
https://www.facebook.com/rei.matsushita
https://twitter.com/rei_m