简体   繁体   English

缩略图悬停时出现新图像

[英]New image on thumbnail hover

Hey all, I'm trying to implement something where I have 2 thumbnail pictures underneath 1 large image. 嘿,我正在尝试实现在1张大图片下有2张缩略图的情况。 I would like the large image to change to another picture when you hover over the thumbnail. 当您将鼠标悬停在缩略图上时,我希望将大图像更改为另一张图片。 Is there a script, or tutorial out there for this? 有没有脚本或教程? Possibly jquery? 可能是jquery?

jQuery would rock this. jQuery会为此震撼。 Here is a tutorial that does something similar. 是一个执行类似操作的教程。 Good luck! 祝好运!

U can do it with hover function 您可以使用悬停功能

CSS CODE: CSS代码:

.nav {
   background:url(images/3.png) no-repeat;
}

.nav_hover {
   background:url(images/4.png) no-repeat;
}

JQUERY CODE: JQUERY代码:

$('.nav').hover( 
function(){
   $(this).addClass('nav_hover');
}, 
function(){
   $(this).removeClass('nav_hover');
}
);

HTML Code: HTML代码:

// Call  class CSS Script to element

Check it 核实

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM