[英]jQuery transparent image description slide animation on mouse hover [closed]
好的,我们开始吧,我为您准备了这个小提琴:
它没有按预期工作,因此我将描述我需要什么以及存在什么问题。 目标是将鼠标悬停在框上时的滑动描述。
这就是我想要的,并且强调了所有无效的内容 :
你能帮助我吗?
试试这个,不确定,但是我认为这是您的答案。
我把小提琴链接单击此处进行演示
和JS代码:
jQuery(function() {
$('.box').hover(function() {
var _tst = this;
jQuery(this).find(".text").animate({
"height": jQuery(_tst).find(".text").height() + jQuery(_tst).find(".desc").height()
}, {
duration: 600,
queue: false
});
jQuery(this).find(".img").animate({
"top": -jQuery(_tst).find(".desc").height()
}, {
duration: 600,
queue: false
});
}, function() {
jQuery(this).find(".text").animate({
"height": "30px"
}, {
duration: 600,
queue: false
});
jQuery(this).find(".img").animate({
"top": 0
}, {
duration: 600,
queue: false
});
});
});
并做了一些CSS更改。 点击此处查看更改
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.