iPhone Safariã§Carousel風ã®UIãå®ç¾ããjQuery PluginãjCarouselãä½ãã¾ãã
iPhoneï½¥iPadã®Webã¢ããªã±ã¼ã·ã§ã³éçºãç¸å¤ãããç 究ãã¦ãã¾ãã
æè¿ã®iPhoneï½¥iPad Webã¢ããªã±ã¼ã·ã§ã³éçºã¨è¨ãã°ãSencha Touchãã§ããããªãªã¼ã¹ããã¦ããä½ã ããã è¨ã訳ãã¦ãã¬ãããªåå¼·ãããã¨ããéãã¦ãã¾ãããã¾ãããããï¼æ¬å½ã«ï¼ã¬ãããªç 究ãã¦ãããã¨æãã¾ãã
ã¨ãåé ã§Sencha Touchã®è©±ã«ãªãã¾ããããä»åã¯jQueryã®ãã©ã°ã¤ã³ã§ãã
jQueryã®iPhone Webã¢ããªã±ã¼ã·ã§ã³éçºã¨è¨ãã°ãjQTouchãã§ãããSencha Touchã«æ¯ã¹ãã¨ç¨æããã¦ããUIãã¤ãã³ããªãããå°ãªããã§ããããHTMLãæ¸ãæ¸ãããã ãã§ãµã¯ãµã¯ä½ãã¡ããã¨ããã¯ããã®ã§ãããããã¡ãã£ã¨Sencha Touchã¿ããã«ããããªUIã使ãããã¨ããã§ãã
ããã§ãjQueryã§ãCarousel風ã®UIããµã¯ãµã¯ãã¨ä½ãã¡ããjQuery PluginãjCarouselããä½ãã¾ããã
jCarousel Demo(できればiPhoneで見てね)
jQTouchã«ç¿ã£ã¦ããã¡ã¤ã«ãèªã¿ããã§HTMLãæ¸ãæ¸ãããã ãã§ä½ãã¡ãããµã¯ãµã¯æ¹å¼ã®ä½¿ãæ¹ãªã®ã§ããã²æ°è»½ã«è©¦ãã¦ã¿ã¦ãã ããã
jQTouchã¨ä½¿ããã¨ãæ³å®ããªããæ¸ãã¦ãã¾ããããå¥ã«åä½ã§ã使ããã®ã§ãjQTouchãããªãã¦ãè¯ãã§ãã
iPhoneï½¥iPadã®Mobile Safariã§åä½ãããã¨ãåæã¨ãã¦ãã¾ãããä¸å¿PCçã®Safariã§ãåãããã«ãã¾ããï¼Firefoxã¯ç¢ºèªãã¦ãã¾ãããããã¶ãåãã¨æãã¾ãï¼ã
jCarousel StartUp Guide
[1] jQueryãDLãã¦ãã¦ä¸ãã
http://jquery.com/ã§jQueryã®ãã¡ã¤ã«ãDLãã¦ä¸ããï¼ãã¼ã¸ã§ã³ã¯1.3ã§ã1.4ã§ãOKï¼ã
[2] ãã©ã°ã¤ã³ãã¡ã¤ã«ãDLãã¦ä¸ãã
ãã©ã°ã¤ã³ãã¡ã¤ã«ãjCarouselããDLãã¦ä¸ããã
jCarousel.min.js (5KB)
[3] ãã¡ã¤ã«ãèªã¿ãã¿ã¾ã
jQueryã¨jCarouselã®JSãã¡ã¤ã«ãèªã¿ãã¿ã¾ã
<script src="js/jquery.1.3.2.min.js" type="text/javascript" charset="utf-8"></script> <script src="js/jCarousel.min.js" type="application/x-javascript" charset="utf-8"></script>
[4] HTMLãæ¸ãã¾ã
ãªã¹ãæ§é ã®HTMLãæ¸ãã¾ãããªã¹ãè¦ç´ ï¼ul or olï¼ã«ã¯ãjCarouselã¯ã©ã¹ãè¨å®ãã¾ãã
<ul class="jCarousel"> <li><img src="sample1.jpg" /></li> <li><img src="sample2.jpg" /></li> <li><img src="sample3.jpg" /></li> </ul>
[5] å®äº
å¾ã¯èªåçã«ããããçæããã¾ãã
jCarouselã¯ã©ã¹ãè¨å®ãããªã¹ãè¦ç´ ã¯CSSã§é«ãæå®ãããæ¹ãè¯ãã¨æãã¾ãã
jQTouchã¨ä¸ç·ã«ä½¿ãå ´å
jQTouchã¨ä¸ç·ã«ä½¿ãå ´åã¯ãjQTouchã®ã¤ãã·ã£ã©ã¤ãºã®å¾ã«ãã©ã°ã¤ã³ãã¡ã¤ã«ãèªã¿ãã¾ãªãã¨ãä¸æããããªããã¨ãããããã§ããã¾ãããã®ã¨ããªã¹ãè¦ç´ ã¯ulãããolã使ã£ãæ¹ãã¤ã¤ã§ãã
AJAXã§åçã«è¡¨ç¤ºããããã¼ã¸ã«jCarouselãè¨ç½®ãããå ´åã¯ãå°ãã³ããããããã§ãAJAXã§åçã«è¡¨ç¤ºããããã¼ã¸ã®æä¸é¨ã«ä»¥ä¸ã®ããã«è¨è¿°ããã¨ããã§ãã
<script type="text/javascript"> $(function(){ $(".jCarousel").css({visibility:"hidden"}); $(".ajaxPage").bind('pageTransitionEnd', function(e, info){ if (info.direction == 'in' && $(this).data('loaded') != 'true'){ jCarousel.set(); $(".jCarousel").css({visibility:"visible"}); } }); }); </script>
CSSã§jCarouselé¨åãé表示ã«ãã¦ããã¦ãAjaxãã¼ã¸ã«é·ç§»ããå¾ã«jCarousel.set()ãå®è¡ããåã³CSSã§è¡¨ç¤ºã«ããã
ã³ã³ã§ã®ãã¤ã³ãã¯ãpageTransitionStartãã§ã¯ãªããpageTransitionEndãã¨ããé¨åã§ããpageTransitionStartãã ã¨ãªãã ãjCarouselã®é«ãã0ã«ãªãä¸æããããªãããã§ãã
jCarousel Demo(できればiPhoneで見てね)
ä»ã«ãä¸å ·åãªã©ããã¾ãããã³ã¡ã³ãä¸ããã
ä¸å ·åã®ä¿®æ£ã»å¤æ´ç¹
â2010/08/10 Ver.1.2
ã»PCãã©ã¦ã¶ã§ã®æä½æã«ã¹ã©ã¤ããä¸æãåããªããã¨ãããä¸å
·åãä¿®æ£ãã¾ããã
ã»PCãã©ã¦ã¶ã®ã¦ã£ã³ãã¦ããªãµã¤ãºããéã«æ¨ªå¹
ãåè¨å®ãããããã«å¤æ´ãã¾ããã
ã»Javascriptãªã©ã§åçã«jCarouselãªã¹ããçæããå ´åã«ãjCarousel.set()é¢æ°ãå¼åºããã¨ã§åçã«çæã§ããããã«å¤æ´ãã¾ããï¼jCarousel.set()é¢æ°ã¯HTMLèªã¿è¾¼ã¿æã«ããã©ã«ãã§å®è¡ããã¾ãï¼ã
â2010/11/28 Ver.1.3
ã»ã¹ã©ã¤ãæã«ã¹ã¯ãã¼ã«ãçºçããªãããã«ä¿®æ£
ã»ã¹ã¯ãã¼ã«æã«ã¤ãã³ããçºçããªãããã«ä¿®æ£
ã»å
¥ãåã§ãªã¹ãè¦ç´ ã使ç¨ããã¨ãã«çºçãããã°ãä¿®æ£
ã»é«ãã®èªååå¾ãè¡ãããã«ä¿®æ£