Try this method:
javascript code:
(you'll also need to get download the most recent verson of the jquery.js file from jquery.com). Place this in a separate javascript file:
jQuery(document).ready(function(){
//Fade Effect
jQuery(".fade span").css("opacity","0");
jQuery(".fade span").hover(
function () {
jQuery(this).stop().animate({
opacity: 1
}, "slow");
},
function () {
jQuery(this).stop().animate({
opacity: 0
}, "slow");
}
);
}); // the closing bracket to the document ready function
css code:
.fade1Btn {
cursor: pointer;
background: url(../images/menu_sitea.png) 0 0px no-repeat;
height:26px; /*adjust this to the width and height of your image*/
width:118px; /*adjust this to the width and height of your image*/
}
.fade1Btn span {
display:block;
text-indent:-99em;
width:118px; /*adjust this to the width and height of your image*/
height:26px; /*adjust this to the width and height of your image*/
background: url(../images/menu_siteb.png) 0 0px no-repeat;
/* You could also use image sprites and change the background position
background: url(../images/menu_sitea.png) 0 -26px no-repeat;*/
cursor: pointer;
}
HTML Code:
<a href="#" class="fade1Btn fade clearfix"><span></span></a>
Last edited by Puddlemut; 03-01-2011 at 04:29 PM..
|