<legend id='P2IoQ'><style id='P2IoQ'><dir id='P2IoQ'><q id='P2IoQ'></q></dir></style></legend>

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

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

        • <bdo id='P2IoQ'></bdo><ul id='P2IoQ'></ul>

      1. <tfoot id='P2IoQ'></tfoot>

        将鼠标悬停在热点上时带有图像弹出窗口的图像映射

        时间:2023-09-30

            • <bdo id='XoBMz'></bdo><ul id='XoBMz'></ul>

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

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

                  本文介绍了将鼠标悬停在热点上时带有图像弹出窗口的图像映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在构建一个日历,其中包含特定日期的事件.日历是我为其创建了图像映射的 jpg.当您将鼠标悬停在日历上的热点或事件"上时,我希望将图像悬停在鼠标指针旁边,上面将显示事件信息,然后在鼠标离开热点时消失.我有六个热点,每个热点都有一个 javascript 函数.这些函数将弹出图像替换为正确的事件图像.下面是其中一个区域和一个功能的示例(其他区域相同,但图像名称和坐标不同)

                  I am building a calendar that has events on certain days. The calendar is a jpg that I have created an image map for. When you hover over a hotspot or "event" on the calendar, I want an image to hover next to the mouse pointer that will have the event information on it, and then disappear when the mouse goes off of the hotspot. I have six hotspots, and a javascript function for each. The functions replace the popup image with the correct event image. Below is an example of just one of the areas along with one function (the others are identical w/ different image names and coords)

                  我在悬停时在日历下方弹出了事件图像,但页面拒绝将图像的位置重新定位到当前鼠标位置.如何使弹出图像重新定位?我究竟做错了什么?还是我应该使用不同的方法?

                  I had the event images popping up below the calendar on hover but the page refused to relocate the position of the image to the current mouse location. How can I make the popup image relocate? What am I doing wrong? or should I be using a different method?

                  JS:

                  function pop(e) { //function called by first hotspot
                          Image.src = "../img/Bubble - Aloha.png" //event image
                          document.popup1.src = Image.src; 
                          var thing = document.getElementById("popup1");
                  
                          $("#popup1").toggle();
                          thing.style.left = e.screenX + 'px';
                          thing.style.top = e.screenY + 'px';
                  
                          return true;
                          }
                  

                  地图:

                  <map id="feb1050" name="feb1050">
                  <area shape="rect" alt="" coords="464,170,588,263" HREF="../img/feb1050.jpg" onMouseOver="pop(event);"  onMouseOut="pop(event);"/>
                  ...</map>
                  

                  HTML:

                  <ul><li>
                          <img src="../img/feb1050.jpg" width="1050" alt="calendar" USEMAP="#feb1050">
                      </li>
                      <li>
                          <div id="popup"><img NAME="popup1" id="popup1" src="../img/Bubble - Aloha.png" width="400" alt="calendar" style="display:none;top:-2000;left:-1000;> 
                          </div><br />Click Here To RSVP! 
                      </li>
                  </ul> 
                  

                  推荐答案

                  也许您可以定位封闭的 div,而不是操纵图像本身的位置.对于 HTML:

                  Perhaps rather than manipulating the position of the image itself, you could position the enclosing div. For the HTML:

                  <div id="popup" class="popup"><img NAME="popup1" id="popup1" src="../img/feb1050.jpg" alt="calendar"> 
                  <br />Click Here To RSVP!</div>
                  

                  为 div 加上一些 CSS:

                  With some CSS for the div:

                  .popup {
                          position:absolute;
                          z-index:20000;
                          top: 0px;
                          left: 0px;
                          display: none;
                  }
                  

                  然后是JS:

                  function pop(e) { //function called by first hotspot
                  
                      Image.src = "../img/Bubble - Aloha.png" //event image
                      document.popup1.src = Image.src; 
                      var thing = document.getElementById("popup");
                  
                      thing.style.left = e.clientX + 'px';
                      thing.style.top = e.clientY  + 'px';
                      $("#popup").toggle();
                  
                      return true;
                   }
                  

                  请注意,我也会使用 clientX 和 clientY 而不是 screenX 和 screenY:

                  Note that I would also use clientX and clientY rather than screenX and screenY:

                  有什么区别screenX/Y、clientX/Y 和 pageX/Y?

                  JSFiddle 上的工作示例

                  这篇关于将鼠标悬停在热点上时带有图像弹出窗口的图像映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:是“aria-haspopup"吗?属性主要用于工具栏菜单? 下一篇:谷歌浏览器在打印预览中不显示图像

                  相关文章

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

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

                    • <bdo id='piTLp'></bdo><ul id='piTLp'></ul>