【问题标题】:Image Map links not firing in a jQuery UI dialog (IE only)图像映射链接未在 jQuery UI 对话框中触发(仅限 IE)
【发布时间】:2010-09-24 09:48:11
【问题描述】:

我正在尝试将图像映射放入 jQuery UI 对话框中。最初,and 隐藏在页面上,因此我不必执行任何 AJAX。当对话框被触发时, 和 被放置在对话框中,并且隐藏的原始内容与图像映射的链接被删除。

标签中的图像地图上有一些链接,在 Firefox、Chrome 等中,这些链接定位正确并且可以正常工作。

但是,在所有版本的 IE 中(网站是 SharePoint 2007 并且兼容模式已打开),链接不会在图像映射上触发。您可以将鼠标悬停在矩形上并显示链接,但该操作永远不会触发。

用于初始化的代码如下:

$(document).ready(function() { 
    $('.processDiagram').click(function() {
        var phase = $(this).attr('title');
        var text = $('#'+phase+' div').html();
        var mapname = $('#'+phase+' map').attr('name');
        $('#'+phase+' map').attr('name', ''); // null out the background map name so it doesn't get confused

        var $dialog = $('<p></p>').html(text).dialog({modal:true, autoOpen:false, width:620, title:phase, beforeClose: function(event, ui) { $('#'+phase+' map').attr('name', mapname); }});
        $dialog.dialog('open');
        return false; // So firefox won't just follow the link
    }
}

我真的可以在这里得到一些帮助,因为我不知道为什么链接没有触发。

谢谢, 史蒂夫

【问题讨论】:

    标签: image jquery-ui sharepoint-2007 dialog area


    【解决方案1】:

    所以,原因是布局是 position:relative 在 IE 上做了一个数字,将所有热点移动到相对于正文而不是图像映射本身。

    解决方案是修复该布局问题。

    【讨论】:

      猜你喜欢
      • 2012-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多