1. <i id='feNpF'><tr id='feNpF'><dt id='feNpF'><q id='feNpF'><span id='feNpF'><b id='feNpF'><form id='feNpF'><ins id='feNpF'></ins><ul id='feNpF'></ul><sub id='feNpF'></sub></form><legend id='feNpF'></legend><bdo id='feNpF'><pre id='feNpF'><center id='feNpF'></center></pre></bdo></b><th id='feNpF'></th></span></q></dt></tr></i><div id='feNpF'><tfoot id='feNpF'></tfoot><dl id='feNpF'><fieldset id='feNpF'></fieldset></dl></div>
      <legend id='feNpF'><style id='feNpF'><dir id='feNpF'><q id='feNpF'></q></dir></style></legend>

      <small id='feNpF'></small><noframes id='feNpF'>

      <tfoot id='feNpF'></tfoot>
        <bdo id='feNpF'></bdo><ul id='feNpF'></ul>

      1. 使用带有 HTML 图像映射的 JQuery 悬停

        Using JQuery hover with HTML image map(使用带有 HTML 图像映射的 JQuery 悬停)

        1. <legend id='osjFU'><style id='osjFU'><dir id='osjFU'><q id='osjFU'></q></dir></style></legend>

        2. <i id='osjFU'><tr id='osjFU'><dt id='osjFU'><q id='osjFU'><span id='osjFU'><b id='osjFU'><form id='osjFU'><ins id='osjFU'></ins><ul id='osjFU'></ul><sub id='osjFU'></sub></form><legend id='osjFU'></legend><bdo id='osjFU'><pre id='osjFU'><center id='osjFU'></center></pre></bdo></b><th id='osjFU'></th></span></q></dt></tr></i><div id='osjFU'><tfoot id='osjFU'></tfoot><dl id='osjFU'><fieldset id='osjFU'></fieldset></dl></div>

          <small id='osjFU'></small><noframes id='osjFU'>

            <bdo id='osjFU'></bdo><ul id='osjFU'></ul>

              <tfoot id='osjFU'></tfoot>
                    <tbody id='osjFU'></tbody>
                  本文介绍了使用带有 HTML 图像映射的 JQuery 悬停的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个复杂的背景图像,其中包含许多需要翻转插图突出显示的小区域,以及每个区域的附加文本显示和相关链接.最终插图使用 z-index 堆叠了几张具有透明度的静态图像,并且高光翻转插图需要显示在中间的三明治"层之一中才能达到预期的效果.

                  I have a complicated background image with a lot of small regions that need rollover illustration highlights, along with additional text display and associated links for each one. The final illustration stacks several static images with transparency using z-index, and the highlight rollover illustrations need to display in one of the in-between "sandwich" layers to achieve the desired effect.

                  在对块的一些不成功的摆弄之后,我决定可以使用老式的图像映射来完成.我制作了一个带有四个几何形状轮廓的示意性测试地图,并使用 png 翻转填充"它们.想法是将图像映射与底部背景层相关联,使用 css {visibility: hidden} 初始化所有翻转,并使用 Jquery 的悬停方法使它们可见,并在单独的 div 中显示关联的文本.单独的文本函数是我不尝试使用 :hover 伪类而不是 jQuery hover 的原因.因为我使用的是图像映射,所以我将所有翻转 png(具有透明背景)的大小调整为完整容器的大小,以便准确放置,以便所有内容都精确排列.

                  After some unsuccessful fiddling with blocks, I decided this might be done with an old-school image map. I made a schematic test map with four geometric shape outlines and "filled" them using with png rollovers. The idea is to associate the image map with the bottom background layer, initialize all the rollovers with css {visibility: hidden} and use Jquery’s hover method to make them visible as well as reveal associated text in a separate div. The separate text function is why I’m not trying to this with the :hover pseudoclass instead of jQuery hover. Because I was using the image map, I made all the rollover pngs (which have transparent backgrounds) sized to the full container for exact placement so everything lines up precisely.

                  我得到的东西......不是真的!正确映射图像映射以仅激活几何区域.但是每个翻转区域的 href 只能间歇性地工作,并且使用带有 css 可见性的 Jquery 悬停是一团糟.期望的行为是滚入该区域只会使形状变得坚固.实际发生的是形状内部的任何运动都会在可见和隐藏之间快速切换;当光标停在形状内时,它可能可见,也可能不可见.任何想法表示赞赏!

                  What I got works... not really! The image map is correctly mapped to activate only the geometric areas. But the href from each rollover area works only intermittently, and using Jquery hover with css visibility is messed up. Desired behavior is that rolling into the area simply would make the shape solid. What actually happens is any motion inside the shape makes rapid toggling between visible and hidden; when the cursor stops within the shape, it might be visible or it might not. Any ideas appreciated!

                  悬停设置示例(我最终将使用数组来实现真正的悬停、关联链接和文本):

                  sample hover setup (I’ll ultimately use arrays for real rollovers, associated links and text):

                  $('#triangle').hover(
                      function() {
                          $('#ID_triangle').css({'visibility' : 'visible'});
                      },
                      function() {
                          $('#ID_triangle').css({'visibility' : 'hidden'});
                      }
                  )
                  

                  图片地图:

                  <div id="container">
                      <img src="images/testMap_w.png" width="800" height="220" alt="TestMap W" usemap="#testMap">
                      <map name="testMap">
                          <area shape="polygon" coords="20,20,106,20,106,106,20,106" href="http://www.stackoverflow.com" id="box" />
                          <area shape="polygon" coords="216,50,339,50,277,156" href="http://www.google.com" id="triangle" />
                          <area shape="polygon" coords="460,0,574,0,460,220" href="http://www.cnn.com" id="bordertriangle" />
                          <area shape="polygon" coords="704,65,769,115,744,196,665,196,640,115" href="http://slashdot.org" id="pentagon" />
                      </map>
                      <img src="images/testMap_box.png" width="800" height="220" alt="TestMap Box" id="ID_box">
                      <img src="images/testMap_triangle.png" width="800" height="220" alt="TestMap Triangle" id="ID_triangle">
                      <img src="images/testMap_border_triangle.png" width="800" height="220" alt="TestMap Border Triangle" id="ID_bordertriangle">
                      <img src="images/testMap_pentagon.png" width="800" height="220" alt="TestMap Pentagon" id="ID_pentagon">
                  </div>
                  

                  推荐答案

                  你应该看看这个插件:

                  https://github.com/kemayo/maphilight

                  和演示:

                  http://davidlynch.org/js/maphilight/docs/demo_usa.html

                  如果有的话,你也许可以借用一些代码来修复你的.

                  if anything, you might be able to borrow some code from it to fix yours.

                  这篇关于使用带有 HTML 图像映射的 JQuery 悬停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ChartJS Version 3 - common legend for multiple line charts(ChartJS 版本 3 - 多个折线图的常用图例)
                  Charts.js scales yaxes ticks min max doesnt work(Charts.js 缩放 yaxes 刻度 min max 不起作用)
                  How to expand the slice of donut chart in chartjs?(如何在chartjs中扩展圆环图的切片?)
                  Chart.js yAxes Ticks stepSize not working (fiddle)(Chart.js yAxes Ticks stepSize 不起作用(小提琴))
                  Rounded corners on chartJS v.2 - bar charts (with negative values)(chartJS v.2 上的圆角 - 条形图(带负值))
                  How to hide value in Chart JS bar(如何在 Chart JS 栏中隐藏值)

                      <tfoot id='JLZ5r'></tfoot>
                      <i id='JLZ5r'><tr id='JLZ5r'><dt id='JLZ5r'><q id='JLZ5r'><span id='JLZ5r'><b id='JLZ5r'><form id='JLZ5r'><ins id='JLZ5r'></ins><ul id='JLZ5r'></ul><sub id='JLZ5r'></sub></form><legend id='JLZ5r'></legend><bdo id='JLZ5r'><pre id='JLZ5r'><center id='JLZ5r'></center></pre></bdo></b><th id='JLZ5r'></th></span></q></dt></tr></i><div id='JLZ5r'><tfoot id='JLZ5r'></tfoot><dl id='JLZ5r'><fieldset id='JLZ5r'></fieldset></dl></div>
                        <bdo id='JLZ5r'></bdo><ul id='JLZ5r'></ul>
                        • <small id='JLZ5r'></small><noframes id='JLZ5r'>

                            <legend id='JLZ5r'><style id='JLZ5r'><dir id='JLZ5r'><q id='JLZ5r'></q></dir></style></legend>
                              <tbody id='JLZ5r'></tbody>