Created
June 9, 2012 14:26
-
-
Save ds729/2901164 to your computer and use it in GitHub Desktop.
画像置換1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
マウスオーバーでaの背景画像のopacityを1にする。CSS3のtransitionでもできる | |
li:hover{opacity:1;} | |
li{transition:0.5s;} | |
*/ | |
div#header ul#header_menu li.header_link03 { | |
background-image: url(../images/header_link03.png); | |
background-repeat: no-repeat; | |
} | |
div#header ul#header_menu li.header_link03 a { | |
background-image: url(../images/header_link03.png); | |
background-position: -130px 0px; | |
} | |
div#header ul#header_menu li a { | |
display:block; | |
height:115px; | |
width:130px; | |
text-indent:-9999px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class="header_link03"> | |
<a href="#staff" style="opacity: 0; ">03 スタッフ</a> | |
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$(function() { | |
$("div#header ul#header_menu li a").css("opacity","0"); | |
//初期設定として画像のopacityを0にします。 | |
$("div#header ul#header_menu li a").hover( //hoverです。 | |
function () { | |
$(this).stop().animate({opacity: 1}, 'fast');}, | |
//マウスオーバー時にopacityを1にします。 | |
function () { | |
$(this).stop().animate({opacity: 0}, 'fast');} | |
//マウスアウト時にopacityを0に戻します。 | |
); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment