我有一个Wordpress插件,名为Videogall,它为Youtube视频创建了一个缩略图库,当点击时,这些缩略图会在一个阴影框中打开。当您在图库中的缩略图上悬停时,下列代码将使所有缩略图不再悬停变得更加透明。
jQuery('.videogall-thumb').hover(function() {
var currThumb = jQuery(this).attr('id');
jQuery('.videogall-thumb[id!="' + currThumb +'"]').stop().animate({opacity: 0.3}, 800);
}, function() {
jQuery('.videogall-thumb').stop().animate({opacity: 1.0}, 800);
}
);我还能添加什么来使正在盘旋的图像也放大,一个悬空脉冲(http://jquery.malsup.com/hoverpulse/)
发布于 2012-08-22 04:56:37
也许是这样的?
jQuery('.videogall-thumb').hover(function() {
var currThumb = jQuery(this).attr('id');
jQuery('.videogall-thumb[id!="' + currThumb +'"]').stop().animate({opacity: 0.3}, 800);
//added lines
jQuery(this).css('width', jQuery(this).css('width') * 1.5);
jQuery(this).css('height', jQuery(this).css('height') * 1.5);
}, function() {
jQuery('.videogall-thumb').stop().animate({opacity: 1.0}, 800);
}
);这假设缩略图具有CSS中指定的宽度和高度(由您或制作它们的插件指定)。
发布于 2012-08-22 17:06:22
这一行代码与没有在上面徘徊的缩略图ids相匹配:
jQuery('.videogall-thumb[id!="' + currThumb +'"]').stop().animate({opacity: 0.3}, 800);如果它被改为
jQuery('.videogall-thumb[id="' + currThumb +'"]').stop().animate({opacity: 0.3}, 800);
id=currThumb instead of id!=currThumb希望这能有所帮助。
https://stackoverflow.com/questions/12066480
复制相似问题