简体   繁体   English

鼠标悬停在文本上会更改固定位置中的图像 - Wordpress

[英]Mouse Hover on text changes images in fix location - Wordpress

I am working on a wordpress page and i want to set a fixed image and 3 different texts at the the bottom of it.我正在处理一个 wordpress 页面,我想在它的底部设置一个固定图像和 3 个不同的文本。

What I want to do is that when the mouse hover on Text1 the top image changes, when the mouse hover Text2 the top images changes again.我想要做的是,当鼠标悬停在Text1 ,顶部图像会发生变化,当鼠标悬停在Text2 ,顶部图像会再次发生变化。

Example: http://fr.muaythaitv.com/pages/helpcenter/advertise.php示例: http : //fr.muaythaitv.com/pages/helpcenter/advertise.php

I searched on internet but couldn't really find what I'm looking for, hope someone can help me!我在互联网上搜索但无法真正找到我要找的东西,希望有人能帮助我!

You mean something like this ?你的意思是这样的

HTML markup. HTML 标记。

<div id="gallery2"> 
    <div id="panel"> 
        <img id="largeImage2" src="http://placehold.it/100/" /> 
        <div id="description">main image with simple links</div> 
    </div> 

    <div id="thumbs2">
        <a href="http://placehold.it/100/ff3322" >link1</a>
         <a href="http://placehold.it/100/ffc5c5">link1</a>
        <a href="http://placehold.it/100/eec777">link1</a>
        <a href="http://placehold.it/100/887744">link1</a>
    </div> 
</div> 

jQuery : jQuery :

$('#thumbs2 a').hover(function(){
   $('#largeImage2').attr('src',$(this).attr('href'));
});

Css at your will .. CSS 随心所欲..

See Here again - it´s the second example is a live link, the third is anchor disabled link.再次参见此处- 第二个示例是实时链接,第三个示例是禁用锚点的链接。

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

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