PHP & JavaScript Room :: 設置サンプル

実行結果

jCarousel | 設置サンプル

画像サイズは、幅75px × 高さ75px。

横長

縦長

自動スクロール(横長)

設置サンプルのソース

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta http-equiv="Content-Language" content="ja" />
      <meta http-equiv="Content-Script-Type" content="text/javascript" />
      <meta http-equiv="Content-Style-Type" content="text/css" />
      <meta http-equiv="imagetoolbar" content="no" />
      <title>jCarousel | 設置サンプル | Staticタイプ</title>
      <script type="text/javascript" src="/content/lib/jcarousel/lib/jquery.js"></script>
      <script type="text/javascript" src="/content/lib/jcarousel/lib/jquery.jcarousel.pack.js"></script><!-- jCarousel library -->
      <link href="/content/lib/global.css" rel="stylesheet" type="text/css" />
      <link rel="stylesheet" type="text/css" href="/content/lib/jcarousel/lib/jquery.jcarousel.css" /><!-- jCarousel core stylesheet -->
      <link rel="stylesheet" type="text/css" href="/content/lib/jcarousel/skins/tango/skin.css" /><!-- jCarousel skin stylesheet -->
      <script type="text/javascript">
         // 自動スクロール(横長)用
         function mycarousel_initCallback(carousel){
             // Disable autoscrolling if the user clicks the prev or next button.
             carousel.buttonNext.bind('click', function() {
                 carousel.startAuto(0);
             });
             carousel.buttonPrev.bind('click', function() {
                 carousel.startAuto(0);
             });
             // Pause autoscrolling if the user moves with the cursor over the clip.
             carousel.clip.hover(function() {
                 carousel.stopAuto();
             }, function() {
                 carousel.startAuto();
             });
         };
         </script>
         <script type="text/javascript">
         $(function(){
            // 横長
             $('#mycarousel').jcarousel();
             // 縦長
             $('#mycarousel_vertical').jcarousel({
                 vertical: true,
                 scroll: 2
             });
             // 自動スクロール(横長)
             $('#mycarousel_autoscroll').jcarousel({
                 auto: 3,
                 wrap: 'last',
                 initCallback: mycarousel_initCallback
             });
         });
      </script>
   <link rel="stylesheet" type="text/css" href="/common/css/example.css"></head>
   <body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP &amp; JavaScript Room</a> :: 設置サンプル</h1>
<h3 class='h'>実行結果</h3>
      <div id="wrap">
         <h1><a href="http://sorgalla.com/projects/jcarousel/">jCarousel</a> | 設置サンプル</h1>
         <p>画像サイズは、幅75px × 高さ75px。</p>
           <h2>横長</h2>
         <script type="text/javascript">
         var photos={
            "bearcake" : "むにゅっとしたクマ顔のどこから食べちゃおうか迷っちゃうケーキ。",
            "deepblue" : "六本木にあるダイニングバー「Deep Blue」の店内でパチリ。",
            "doughnuts" : "話題のカーネル・クリスピー・ドーナッツ。いつも長蛇の列・・・",
            "food" : "恵比寿のSilver.gで食べたコース料理の前菜。ちまちましてかわゆい。しかもおいしかったw",
            "gintocake" : "銀座GINTOのデザート。友達がバースデーだったのでケーキはもちろんホールサービス★",
            "mac" : "マックのポテト。週1回食べないと禁断症状が(汗;",
            "magicspice" : "下北沢にある激辛スープカレーの店「Magic Spice」のアクエリアス。5口目から快感になる不思議なカレー。",
            "sexyleglump" : "セクシーレッグランプ。ネットで見て衝動買い。実物はかなりでかかった・・・"
         };
         </script>
         <ul id="mycarousel" class="jcarousel-skin-tango">
            <script type="text/javascript">
               for(var key in photos){
                  document.write("<li><img src='/content/lib/galleryimages/75x75/"+key+".jpg' width='75' height='75' alt='"+photos[key]+"' \/><\/li>\n");
               }
            </script>
         </ul>
         <h2>縦長</h2>
         <ul id="mycarousel_vertical" class="jcarousel-skin-tango">
            <script type="text/javascript">
               for(var key in photos){
                  document.write("<li><img src='/content/lib/galleryimages/75x75/"+key+".jpg' width='75' height='75' alt='"+photos[key]+"' \/><\/li>\n");
               }
            </script>
         </ul>
         <h2>自動スクロール(横長)</h2>
         <ul id="mycarousel_autoscroll" class="jcarousel-skin-tango">
            <script type="text/javascript">
               for(var key in photos){
                  document.write("<li><img src='/content/lib/galleryimages/75x75/"+key+".jpg' width='75' height='75' alt='"+photos[key]+"' \/><\/li>\n");
               }
            </script>
         </ul>
      </div>
   </body>
</html>