① フリープラグインへ追記
<script type='text/javascript' src='http://stat100.ameba.jp/blog/js/apm001.js'></script>
<script type="text/javascript">
$(function(){
var mvw=2; // 横揺れ pxの値( 2 は 2pxの意味)
var mvh=2; // 縦揺れ pxの値( 2 は 2pxの意味)
var tw=10; // 横揺れ時間 10は。0.01秒
var th=10; // 縦揺れ時間 10は。0.01秒
$("a.detailOn").mouseover(function(){
$(this).css({position: 'relative'});
$(this).stop()
// 横揺れ 開始
.animate({left : mvw+'px'},tw)
.animate({left : mvw*-1+'px'},tw)
.animate({left : mvw+'px'},tw)
.animate({left : mvw*-1+'px'},tw)
.animate({left : mvw+'px'},tw)
.animate({left : mvw*-1+'px'},tw)
.animate({left : mvw+'px'},tw)
.animate({left : mvw*-1+'px'},tw)
// 縦揺れ 開始
.animate({top : mvh+'px'},th)
.animate({top : mvh*-1+'px'},th)
.animate({top : mvh+'px'},th)
.animate({top : mvh*-1+'px'},th)
.animate({top : mvh+'px'},th)
.animate({top : mvh*-1+'px'},th)
.animate({top : mvh+'px'},th)
.animate({top : mvh*-1+'px'},th)
})});
</script>
<script type="text/javascript">
$(function(){
var mvw=2; // 横揺れ pxの値( 2 は 2pxの意味)
var mvh=2; // 縦揺れ pxの値( 2 は 2pxの意味)
var tw=10; // 横揺れ時間 10は。0.01秒
var th=10; // 縦揺れ時間 10は。0.01秒
$("a.detailOn").mouseover(function(){
$(this).css({position: 'relative'});
$(this).stop()
// 横揺れ 開始
.animate({left : mvw+'px'},tw)
.animate({left : mvw*-1+'px'},tw)
.animate({left : mvw+'px'},tw)
.animate({left : mvw*-1+'px'},tw)
.animate({left : mvw+'px'},tw)
.animate({left : mvw*-1+'px'},tw)
.animate({left : mvw+'px'},tw)
.animate({left : mvw*-1+'px'},tw)
// 縦揺れ 開始
.animate({top : mvh+'px'},th)
.animate({top : mvh*-1+'px'},th)
.animate({top : mvh+'px'},th)
.animate({top : mvh*-1+'px'},th)
.animate({top : mvh+'px'},th)
.animate({top : mvh*-1+'px'},th)
.animate({top : mvh+'px'},th)
.animate({top : mvh*-1+'px'},th)
})});
</script>
◆ 説明
・黄色い部分の赤色の数字部分は、変えられます。
左右の揺れのpxと時間
上下の揺れのpxと時間
・ 上記の、下記はフリープラグインの最初に1つあればOKです。
(尚、ベーシックスキンの場合は、不要です)
<script type='text/javascript' src='http://stat100.ameba.jp/blog/js/apm001.js'></script>
・ 普通に投稿した画像のみ揺れます
・ 下記部分を変えることによって、投稿した画像以外にも
適用することが可能です
a.detailOn
◆ 例