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

実行結果

設置サンプル

参照:Nivo Zoom

▼サムネイル画像をクリックすると原寸大画像をポップアウト表示します。

centerを指定
topRightを指定

bottomLeftを指定
topLeftを指定
bottomRightを指定

設置サンプルのソース

<!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>設置サンプル</title>
      <link rel="stylesheet" type="text/css" href="/content/lib/global.css" />
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
      <script type="text/javascript" src="/content/lib/jquery/jquery.nivo.zoom.js"></script>
      <script type="text/javascript">
         $(window).load(function() {
            $('body').nivoZoom();
         });
         $(function(){
            $('#demo a').click(function(){
                  return false;
            });
         });
      </script>
      <style type="text/css">
#demo {
   margin:100px;
}
/*
 * jQuery Nivo Zoom v1.0
 * http://nivozoom.dev7studios.com
 *
 * Copyright 2010, Gilbert Pellegrom
 * Free to use and abuse under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * April 2010
 */
.nivoZoomHover {
   position:absolute;
   top:0px;
   left:0px;
   z-index:9;
   width:100%;
   height:100%;
   cursor:pointer;
}
.nivoCaption {
   display:none;
   position:absolute;
   z-index:110;
   text-align:center;
   background:#010101;
   color:#fff;
   padding:4px 0;
   overflow:hidden;
}
      </style>
   <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>設置サンプル</h1>
         <p>参照:<a href='http://nivozoom.dev7studios.com' target='_blank'>Nivo Zoom</a></p>
         <p>▼サムネイル画像をクリックすると原寸大画像をポップアウト表示します。</p>
<!-- CODE -->
<div id="demo">
   <a href="http://farm2.static.flickr.com/1328/5153659156_0bf5a33280_m.jpg" class="nivoZoom">
      <img src="http://farm2.static.flickr.com/1328/5153659156_0bf5a33280_s.jpg" alt="" width="75" />
   </a>
   <a href="http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_m.jpg" class="nivoZoom center">
      <img src="http://farm2.static.flickr.com/4055/5153644500_b95ccefb3f_s.jpg" alt="" width="75" />
      <div class="nivoCaption">centerを指定</div>
   </a>
   <a href="http://farm5.static.flickr.com/4017/5153037255_d91f4696f1_m.jpg" class="nivoZoom topRight">
      <img src="http://farm2.static.flickr.com/4017/5153037255_d91f4696f1_s.jpg" alt="" width="75" />
      <div class="nivoCaption"><em>topRight</em>を指定</div>
   </a>
   <br>
   <a href="http://farm3.static.flickr.com/2713/4355301371_10fe701412_m.jpg" class="nivoZoom bottomLeft">
      <img src="http://farm2.static.flickr.com/2713/4355301371_10fe701412_s.jpg" alt="" width="75" />
      <div class="nivoCaption"><em>bottomLeft</em>を指定</div>
   </a>
   <a href="http://farm5.static.flickr.com/4034/4334223017_3b77ffd160_m.jpg" class="nivoZoom topLeft">
      <img src="http://farm2.static.flickr.com/4034/4334223017_3b77ffd160_s.jpg" alt="" width="75" />
      <div class="nivoCaption"><em>topLeft</em>を指定</div>
   </a>
   <a href="http://farm5.static.flickr.com/4037/5153052139_34da37cfbd_m.jpg" class="nivoZoom bottomRight">
      <img src="http://farm5.static.flickr.com/4037/5153052139_34da37cfbd_s.jpg" alt="" width="75" />
      <div class="nivoCaption"><em>bottomRight</em>を指定</div>
   </a>
</div>
<!-- / CODE -->
      </div>
   </body>
</html>