実行結果
設置サンプルのソース
<!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" href="/content/lib/global.css" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$(".button").hover(function(){
$(this).find("img")
.animate({top:"-10px"}, 200).animate({top:"-4px"}, 200) // first jump
.animate({top:"-7px"}, 100).animate({top:"-4px"}, 100) // second jump
.animate({top:"-6px"}, 100).animate({top:"-4px"}, 100); // the last jump
});
});
</script>
<!-- CSS -->
<style type="text/css">
.button {
position:relative;
height:14px;
margin:0 10px 0 20px; padding:5px 10px 5px 15px;
cursor:pointer;
display:inline-block;
font-size:11px;
text-decoration:none;
background:#fff;
font-weight:bold;
-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px;
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
}
.button img {
position:absolute;
top:-4px; left:-12px;
border:0;
}
.btn_send {
border:solid 1px #63D517;
color:#63D517;
}
.btn_send:hover {
background:#CDFFAF;
}
.btn_cancel {
border:solid 1px #FF8358;
color:#FF8358;
}
.btn_cancel:hover {
background:#FFC7AF;
}
fieldset {
padding:10px;
width:350px;
}
textarea {
width:310px; height:10em;
margin:0 20px;
}
.right {
text-align:right;
}
</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 & JavaScript Room</a> :: 設置サンプル</h1>
<h3 class='h'>実行結果</h3>
<div id="wrap">
<h1>設置サンプル</h1>
<p>参照:<a href='http://www.jankoatwarpspeed.com/post/2009/03/11/How-to-create-Skype-like-buttons-using-jQuery.aspx'>How to create Skype-like buttons using jQuery</a></p>
<p>▼ボタンにマウスオーバーすると、アイコンがアニメーションします。</p>
<!-- CODE -->
<fieldset>
<legend>コメント</legend>
<p><textarea></textarea></p>
<p class="right">
<a class="button btn_send" href="#" onclick="return false;"><img src="/content/img/ajax/skype_like_buttons/btn_send.png" alt="" />送信する</a>
or
<a class="button btn_cancel" href="#" onclick="return false;"><img src="/content/img/ajax/skype_like_buttons/btn_cancel.png" alt="" />キャンセル</a>
</p>
</fieldset>
<!-- / CODE -->
</div>
</body>
</html>