![](https://stat100.ameba.jp/blog/img/user/expansion.png)
この画像を調整します。
◆ 参考:拡大するの画像は、横 58px 縦 27pxとなっています。
◆ 拡大するの画像を変える
① 利用した画像は下記(横 135px 縦 87px)
![](https://stat001.ameba.jp/user_images/20111029/09/new-blue-777/3d/7d/g/o0135008711576658562.gif?caw=800)
下記サイトさまを利用させていただきました
http://www.mikokt.com/coments.htm
![かわいい画像素材み~っけ!](https://img-proxy.blog-video.jp/images?url=http%3A%2F%2Fwww.mikokt.com%2Fmyimg%2Frogo1.gif)
② CSSへ下記を追記する。
/* ------------------------------------------------------- */
/* 拡大するの噴出し画像を変更する */
/* ------------------------------------------------------- */
#naviLink img{/* 拡大するの画像 */
visibility:hidden;/* 表示しない */
}
#naviLink{/* 拡大するの画像エリア */
background-image:url(画像のURL);
background-repeat:no-repeat;
width:135px;/* 画像の横幅 */
height:87px;/* 画像の縦 */
margin-left:35px;/* 左右へ位置を調整 */
margin-top:-5px;/* 上下の位置を調整 */
}
/* 拡大するの噴出し画像を変更する */
/* ------------------------------------------------------- */
#naviLink img{/* 拡大するの画像 */
visibility:hidden;/* 表示しない */
}
#naviLink{/* 拡大するの画像エリア */
background-image:url(画像のURL);
background-repeat:no-repeat;
width:135px;/* 画像の横幅 */
height:87px;/* 画像の縦 */
margin-left:35px;/* 左右へ位置を調整 */
margin-top:-5px;/* 上下の位置を調整 */
}
![](https://stat100.ameba.jp/blog/ucs/img/char/char2/301.gif)
![](https://stat100.ameba.jp/blog/ucs/img/char/char2/269.gif)
画像より大きい値を指定すると点滅してしまいます。
![](https://stat100.ameba.jp/blog/ucs/img/char/char2/270.gif)
◆ 拡大するの噴出しを消す
① 下記をCSSへ追記する
/* ------------------------------------------------------- */
/* 拡大するの噴出し画像を消す */
/* ------------------------------------------------------- */
#naviLink img{
display:none;
}
/* 拡大するの噴出し画像を消す */
/* ------------------------------------------------------- */
#naviLink img{
display:none;
}
◆ 拡大するが表示されるのは、記事内の画像で、記事編集ページで画像ボタンを
クリックして記事に貼り付けた画像に限ります。
クリックして記事に貼り付けた画像に限ります。
● ランダムに画像を変えたい場合
① フリープラグインへ追記
<script type='text/javascript' src='http://stat100.ameba.jp/blog/js/apm001.js'></script>
<script type='text/javascript'>
imagex = new Array();
imagex[0]='画像のURL①';
imagex[1]='画像のURL②';
imagex[2]='画像のURL③';
imagex[3]='画像のURL④';
imagex[4]='画像のURL⑤';
$(function(){
$("a.detailOn").mouseover(function(){
x=Math.floor(Math.random()*imagex.length);
$('#naviLink').css("background-image","url("+imagex[x]+")");
})})
</script>
<script type='text/javascript'>
imagex = new Array();
imagex[0]='画像のURL①';
imagex[1]='画像のURL②';
imagex[2]='画像のURL③';
imagex[3]='画像のURL④';
imagex[4]='画像のURL⑤';
$(function(){
$("a.detailOn").mouseover(function(){
x=Math.floor(Math.random()*imagex.length);
$('#naviLink').css("background-image","url("+imagex[x]+")");
})})
</script>
![](https://stat100.ameba.jp/blog/ucs/img/char/char2/301.gif)
![](https://stat100.ameba.jp/blog/ucs/img/char/char2/269.gif)
![](https://stat100.ameba.jp/blog/ucs/img/char/char2/270.gif)
<script type='text/javascript' src='http://stat100.ameba.jp/blog/js/apm001.js'></script>
● 実例