我正在尝试将图像映射放入 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
}
}
我真的可以在这里得到一些帮助,因为我不知道为什么链接没有触发。
谢谢,史蒂夫