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

実行結果

設置サンプル

参照:Cloud Zoom

▼画像の一部を拡大表示します。

画像内でフォーカス移動

フォーカスを当てた場所だけ拡大表示

フォーカスを当てた場所だけ拡大表示(ソフトフォーカス、拡大表示位置指定)

設置サンプルのソース

<!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" />
      <!-- JS -->
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" ></script>
      <script type="text/javascript" src="/content/lib/jquery/cloud-zoom.1.0.2.js" ></script>
      <script type="text/javascript">
         $(function() {
         });
      </script>
      <!-- CSS -->
      <style type="text/css">
/* This is the moving lens square underneath the mouse pointer. */
.cloud-zoom-lens {
   border: 4px solid #888;
   margin:-4px;   /* Set this to minus the border thickness. */
   background-color:#fff;   
   cursor:move;
}
/* This is for the title text. */
.cloud-zoom-title {
   font-family:Arial, Helvetica, sans-serif;
   position:absolute !important;
   background-color:#000;
   color:#fff;
   padding:3px;
   width:100%;
   text-align:center;   
   font-weight:bold;
   font-size:10px;
   top:0px;
}
/* This is the zoom window. */
.cloud-zoom-big {
   border:4px solid #ccc;
   overflow:hidden;
}
/* This is the loading message. */
.cloud-zoom-loading {
   color:white;   
   background:#222;
   padding:3px;
   border:1px solid #000;
}
      </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://www.professorcloud.com/mainsite/cloud-zoom.htm' target='_blank'>Cloud Zoom</a></p>
         <p>▼画像の一部を拡大表示します。</p>
<!-- CODE -->
         <h2>画像内でフォーカス移動</h2>
         <div class="cf" style="position:relative; margin:20px;">
            <a href='http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_z.jpg' class='cloud-zoom' id='zoom1' style="float:left" rel="position: 'inside' , showTitle: false, adjustX:-4, adjustY:-4"><img src="http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_m.jpg" alt="" title="ミルクレープ" /></a>
         </div>
         <h2>フォーカスを当てた場所だけ拡大表示</h2>
         <div class="cf" style="position:relative; margin:20px;">
            <a href='http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_z.jpg' class='cloud-zoom' id='zoom2' style="float:left" rel="adjustX: 10, adjustY:-4, softFocus:false"><img src="http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_m.jpg" alt="" title="ミルクレープ" /> 
            </a> 
            <p style="float:left; margin:20px;" >
               <a href='http://farm5.static.flickr.com/1328/5153659156_0bf5a33280_z.jpg' class='cloud-zoom-gallery' title='ミルクレープ 1/3' rel="useZoom: 'zoom2', smallImage: 'http://farm5.static.flickr.com/1328/5153659156_0bf5a33280_m.jpg' "> <img src="http://farm5.static.flickr.com/1328/5153659156_0bf5a33280_s.jpg" alt=""/></a> 
               <a href='http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_z.jpg' class='cloud-zoom-gallery' title='ミルクレープ 2/3' rel="useZoom: 'zoom2', smallImage: 'http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_m.jpg' "><img src="http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_s.jpg" alt=""/></a> 
               <a href='http://farm5.static.flickr.com/4017/5153037255_d91f4696f1_z.jpg' class='cloud-zoom-gallery' title='ミルクレープ 3/3' rel="useZoom: 'zoom2', smallImage: 'http://farm5.static.flickr.com/4017/5153037255_d91f4696f1_m.jpg' "><img src="http://farm5.static.flickr.com/4017/5153037255_d91f4696f1_s.jpg" alt=""/></a> 
            </p>
         </div>
         <h2>フォーカスを当てた場所だけ拡大表示(ソフトフォーカス、拡大表示位置指定)</h2>
         <div class="cf" style="position:relative; margin:20px;">
            <a href='http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_z.jpg' 
               class='cloud-zoom' 
               id='zoom3' style="float:left" 
               rel="softFocus: true, position:'anypos', tint: '#ff6600',tintOpacity:0.5 ,smoothMove:5,">
               <img src="http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_m.jpg" 
               alt="" title="ミルクレープ" /> 
            </a> 
            <div style="float:left; margin:20px;" >
               <a href='http://farm5.static.flickr.com/1328/5153659156_0bf5a33280_z.jpg' class='cloud-zoom-gallery' title='ミルクレープ 1/3'
               rel="useZoom: 'zoom3', smallImage: 'http://farm5.static.flickr.com/1328/5153659156_0bf5a33280_m.jpg' "> 
               <img src="http://farm5.static.flickr.com/1328/5153659156_0bf5a33280_s.jpg" alt=""/></a> 
               <a href='http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_z.jpg' class='cloud-zoom-gallery' title='ミルクレープ 1/3'
               rel="useZoom: 'zoom3', smallImage: 'http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_m.jpg' "> 
               <img src="http://farm5.static.flickr.com/4055/5153644500_b95ccefb3f_s.jpg" alt=""/></a> 
               <a href='http://farm5.static.flickr.com/4017/5153037255_d91f4696f1_z.jpg' class='cloud-zoom-gallery' title='ミルクレープ 1/3'
               rel="useZoom: 'zoom3', smallImage: 'http://farm5.static.flickr.com/4017/5153037255_d91f4696f1_m.jpg' "> 
               <img src="http://farm5.static.flickr.com/4017/5153037255_d91f4696f1_s.jpg" alt=""/></a> 
            </div>
             <div id="anypos" style="position:absolute;top:0; left:510px;width:145px; height:145px;"></div> 
         </div>
<!-- / CODE -->
      </div>
   </body>
</html>