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

実行結果

エフェクト操作:カスタム:animate(params, options)の使用例 | jQuery

▼ペンギン(テキスト含む)にマウスオーバーすると、吹き出しがアニメーション表示されます。

設置サンプルのソース

<!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>エフェクト操作:カスタム:animate(params, options)の使用例 | jQuery</title>
      <link rel="stylesheet" type="text/css" href="/content/lib/global.css" />
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
      <script type="text/javascript">
         $(document).ready(function(){
            $(".menu a").hover(function() {
               $(this).next("span").animate({opacity:"show", top:"-220"}, "slow");
            }, function() {
               $(this).next("span").animate({opacity:"hide", top:"-200"}, "fast");
            });
         });
      </script>
      <style type="text/css">
         .menu { margin:270px 0 0 0; padding:0; list-style:none; }
         .menu li { margin:0 10px 0 0; padding:0; float:left; position:relative; text-align:center; }
         .menu a { margin:0; padding:0 0 0 55px; display:block; color:#000; width:270px; line-height:68px; text-decoration:none; font-weight:bold; display:block; background:transparent url("/content/img/ajax/jquery/pengin.gif") no-repeat 0 0; text-align:left; }
         .menu li span { background:transparent url("/content/img/ajax/jquery/speechbubble.gif") no-repeat 0 0; width:270px; height:222px; position:absolute; top:-200px; left:0; margin:0; padding:0; text-align:center; font-style:normal; z-index:2; display:none; }
         .menu li span img { padding:15px 0 0 5px; }
      </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>エフェクト操作:カスタム:animate(params, options)の使用例 | jQuery</h1>
         <p>▼ペンギン(テキスト含む)にマウスオーバーすると、吹き出しがアニメーション表示されます。</p>
<!-- CODE -->
         <div class="cf">
            <ul class="menu">
               <li><a href="http://www.webdesignerwall.com">モツ鍋@鳥小屋</a><span><img src="http://farm4.static.flickr.com/3239/3032375082_fd66d11941_m.jpg" width="240" height="180" alt="モツ鍋@鳥小屋" /></span></li>
               <li><a href="http://bestwebgallery.com">レバ刺@鳥小屋</a><span><img src="http://farm4.static.flickr.com/3064/3031535599_2f8b454232_m.jpg" width="240" height="180" alt="レバ刺@鳥小屋" /></span></li>
               <li><a href="http://www.ndesign-studio.com">明太子玉子焼き@鳥小屋</a><span><img src="http://farm4.static.flickr.com/3217/3031535573_6e541be249_m.jpg" width="240" height="180" alt="明太子玉子焼き@鳥小屋" /></span></li>
            </ul>
         </div>
<!-- / CODE -->
      </div>
   </body>
</html>