I m试图说明如何将口头陈述合并到同一套头功能中。
基本上,我有一个形象,即当我对四分五裂时,先lide倒右边,而新的形象则倒塌取而代之。
Here s the code I have so far:
//Set div dimensions equal to image s dimensions:
$( #image_holder ).width($( #image_1 ).width());
$( #image_holder ).height($( #image_1 ).height());
//tell the browser what to do when hovering on the div:
$( #image_holder ).hover(function() {
//when mouse hover:
$( #image_0 ).animate({right: - + $(this).width() + px }, /*duration*/360, /*ease*/ swing );
$( #image_1 ).animate({right: 0px }, /*duration*/360, /*ease*/ swing );
},
function() {
//when mouse out, no hover:
$( #image_0 ).animate({right: 0px }, /*duration*/360, /*ease*/ swing );
$( #image_1 ).animate({right: - + $(this).width() + px }, /*duration*/360, /*ease*/ swing );
});
我的超文本很简单:
<div id="image_holder" class="image_holder">
<img id="image_0" class="image" src="images.png" />
<img id="image_1" class="image" src="images_hover.png" />
</div>
Right now, the first image (image_0) does slide out, but the second image (image_1) does not slide in. I have a feeling it s something simple I m messing up...
任何建议都将受到高度赞赏。
感谢。