2017-04-02 21 views
1

logocopy3 イメージの特定の部分(エリアマップ)とホバー効果をリンクする問題があります。現在、私はイメージマップの各セクションをクリックすることができ、必要なページに誘導しますが、ユーザーがクリックする前にホバー効果を表示して、どのページにナビゲートしているかを知りたいと思います。 基本的には、ユーザーが特定の領域を移動するたびに、イメージマップの上に同じ位置にあるテキストを表示しようとしています。次のようにイメージマップ。特定の領域にカーソルを置いたときにテキストを表示する

私のコードは次のとおりです。

<div>  
<img src="logocopy3.png" id="logo" style="width: 260px; max-width: 100%;  
height: auto;" alt="" usemap="#map" /> 

<map name="map"> 
    <area shape="circle" coords="243,132,41" href="Ktrack.html" alt=''/> 
    <area shape="circle" coords="189,223,41" alt='' href="Kinsurance.html" /> 
    <area shape="circle" coords="69,205,29" alt='' href='Khealth.html'/> 
    <area shape="circle" coords="9,131,42" alt='' href='Klocklock.html' /> 
    <area shape="circle" coords="128,49,81" alt='' href='index.html'/> 
</map> 

</div> 
+0

の中にtitle = ""属性を使用すると、情報を表示することができます。 –

+0

これを詳しく説明してください。何かがうまくいくように見えました。 mouseoverオプションは私には正確だと思われますが、私はマウスオーバーをエリア位置にリンクすることができません。 – harry

+0

ここにlogocopy3イメージをアップロードできますか? –

答えて

2

私はtooltipsterのjQueryプラグインを使用してデモを作成し、これは私がそうすることを発見した最良の方法です;)

$(document).ready(function() { 
 
    $('.tooltip').tooltipster({ 
 

 
    }); 
 
});
<script src="http://code.jquery.com/jquery-1.10.0.min.js"></script> 
 
<script src="http://iamceege.github.io/tooltipster/dist/js/tooltipster.bundle.js"></script> 
 
<link href="http://iamceege.github.io/tooltipster/dist/css/tooltipster.bundle.min.css" rel="stylesheet" /> 
 

 
<div> 
 
    <img src="https://i.stack.imgur.com/JRo8A.png" id="logo" style="width: 260px; max-width: 100%;  
 
height: auto;" alt="" usemap="#map" /> 
 

 
    <map name="map"> 
 
    <area shape="circle" coords="243,132,41" href="Ktrack.html" class="tooltip" title="This is my image's tooltip message for area 1!" /> 
 
    <area shape="circle" coords="189,223,41" alt='' href="Kinsurance.html" class="tooltip" title="This is my image's tooltip message for area 2!"/> 
 
    <area shape="circle" coords="69,205,29" alt='' href='Khealth.html' class="tooltip" title="This is my image's tooltip message for area 3!"/> 
 
    <area shape="circle" coords="9,131,42" alt='' href='Klocklock.html' class="tooltip" title="This is my image's tooltip message for area 5!" /> 
 
    <area shape="circle" coords="128,49,81" alt='' href='index.html' class="tooltip" title="This is my image's tooltip message for area 6!" /> 
 
</map> 
 

 
</div>

+0

それはちょうどそれです、ちょうど画像の上に表示されるテキストを取得するには、CSSと遊ぶ必要があります!おかげさまでサヒル! – harry

+0

あなたは歓迎されていますハリー..将来回答する人がこれを参照できるようにするには、答えを受け入れてupvoteしてください;) –

+0

はホバリング時に現れる暗い灰色の背景を取り除く方法です。テキストを表示しますか? – harry

関連する問題